<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow, 2000-2006

\section[Finder]{Module Finder}
-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-9"></span><span>
</span><span id="line-10"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Driver.Finder</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-11"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#flushFinderCaches"><span class="hs-identifier">flushFinderCaches</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>    </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier">FindResult</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#findImportedModule"><span class="hs-identifier">findImportedModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#findPluginModule"><span class="hs-identifier">findPluginModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#findExactModule"><span class="hs-identifier">findExactModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#findHomeModule"><span class="hs-identifier">findHomeModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#findExposedPackageModule"><span class="hs-identifier">findExposedPackageModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#mkHomeModLocation"><span class="hs-identifier">mkHomeModLocation</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#mkHomeModLocation2"><span class="hs-identifier">mkHomeModLocation2</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#mkHiOnlyModLocation"><span class="hs-identifier">mkHiOnlyModLocation</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#mkHiPath"><span class="hs-identifier">mkHiPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#mkObjPath"><span class="hs-identifier">mkObjPath</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#addHomeModuleToFinder"><span class="hs-identifier">addHomeModuleToFinder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#uncacheModule"><span class="hs-identifier">uncacheModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#mkStubPaths"><span class="hs-identifier">mkStubPaths</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#findObjectLinkableMaybe"><span class="hs-identifier">findObjectLinkableMaybe</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#findObjectLinkable"><span class="hs-identifier">findObjectLinkable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#cannotFindModule"><span class="hs-identifier">cannotFindModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>    </span><span class="annot"><a href="GHC.Driver.Finder.html#cannotFindInterface"><span class="hs-identifier">cannotFindInterface</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.html"><span class="hs-identifier">GHC.Unit</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#gHC_PRIM"><span class="hs-identifier">gHC_PRIM</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Ways.html"><span class="hs-identifier">GHC.Driver.Ways</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Outputable</span></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier">expectJust</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier">IORef</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier">readIORef</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#atomicModifyIORef%27"><span class="hs-identifier">atomicModifyIORef'</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../directory/src/System.Directory.html#"><span class="hs-identifier">System.Directory</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../filepath/src/System.FilePath.html#"><span class="hs-identifier">System.FilePath</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.html#"><span class="hs-identifier">Data.Time</span></a></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-keyword">type</span><span> </span><span id="FileExt"><span class="annot"><a href="GHC.Driver.Finder.html#FileExt"><span class="hs-identifier hs-var">FileExt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>   </span><span class="hs-comment">-- Filename extension</span><span>
</span><span id="line-57"></span><span class="hs-keyword">type</span><span> </span><span id="BaseName"><span class="annot"><a href="GHC.Driver.Finder.html#BaseName"><span class="hs-identifier hs-var">BaseName</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>  </span><span class="hs-comment">-- Basename of file</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-60"></span><span class="hs-comment">-- The Finder</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-comment">-- The Finder provides a thin filesystem abstraction to the rest of</span><span>
</span><span id="line-63"></span><span class="hs-comment">-- the compiler.  For a given module, it can tell you where the</span><span>
</span><span id="line-64"></span><span class="hs-comment">-- source, interface, and object files for that module live.</span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-comment">-- It does *not* know which particular package a module lives in.  Use</span><span>
</span><span id="line-67"></span><span class="hs-comment">-- Packages.lookupModuleInAllUnits for that.</span><span>
</span><span id="line-68"></span><span>
</span><span id="line-69"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-70"></span><span class="hs-comment">-- The finder's cache</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span class="hs-comment">-- remove all the home modules from the cache; package modules are</span><span>
</span><span id="line-73"></span><span class="hs-comment">-- assumed to not move around during a session.</span><span>
</span><span id="line-74"></span><span class="annot"><a href="GHC.Driver.Finder.html#flushFinderCaches"><span class="hs-identifier hs-type">flushFinderCaches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span id="flushFinderCaches"><span class="annot"><span class="annottext">flushFinderCaches :: HscEnv -&gt; IO ()
</span><a href="GHC.Driver.Finder.html#flushFinderCaches"><span class="hs-identifier hs-var hs-var">flushFinderCaches</span></a></span></span><span> </span><span id="local-6989586621680949897"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949897"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-76"></span><span>  </span><span class="annot"><span class="annottext">IORef FinderCache -&gt; (FinderCache -&gt; (FinderCache, ())) -&gt; IO ()
forall a b. IORef a -&gt; (a -&gt; (a, b)) -&gt; IO b
</span><a href="../../base/src/GHC.IORef.html#atomicModifyIORef%27"><span class="hs-identifier hs-var">atomicModifyIORef'</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FinderCache
</span><a href="#local-6989586621680949896"><span class="hs-identifier hs-var">fc_ref</span></a></span><span> </span><span class="annot"><span class="annottext">((FinderCache -&gt; (FinderCache, ())) -&gt; IO ())
-&gt; (FinderCache -&gt; (FinderCache, ())) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680949895"><span class="annot"><span class="annottext">FinderCache
</span><a href="#local-6989586621680949895"><span class="hs-identifier hs-var">fm</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(InstalledModule -&gt; InstalledFindResult -&gt; Bool)
-&gt; FinderCache -&gt; FinderCache
forall a.
(InstalledModule -&gt; a -&gt; Bool)
-&gt; InstalledModuleEnv a -&gt; InstalledModuleEnv a
</span><a href="GHC.Unit.Module.Env.html#filterInstalledModuleEnv"><span class="hs-identifier hs-var">filterInstalledModuleEnv</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule -&gt; InstalledFindResult -&gt; Bool
forall {p}. InstalledModule -&gt; p -&gt; Bool
</span><a href="#local-6989586621680949893"><span class="hs-identifier hs-var">is_ext</span></a></span><span> </span><span class="annot"><span class="annottext">FinderCache
</span><a href="#local-6989586621680949895"><span class="hs-identifier hs-var">fm</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-78"></span><span>        </span><span id="local-6989586621680949892"><span class="annot"><span class="annottext">this_pkg :: Unit
</span><a href="#local-6989586621680949892"><span class="hs-identifier hs-var hs-var">this_pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Unit
</span><a href="GHC.Driver.Session.html#homeUnit"><span class="hs-identifier hs-var">homeUnit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949897"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span>        </span><span id="local-6989586621680949896"><span class="annot"><span class="annottext">fc_ref :: IORef FinderCache
</span><a href="#local-6989586621680949896"><span class="hs-identifier hs-var hs-var">fc_ref</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IORef FinderCache
</span><a href="GHC.Driver.Types.html#hsc_FC"><span class="hs-identifier hs-var hs-var">hsc_FC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949897"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-80"></span><span>        </span><span id="local-6989586621680949893"><span class="annot"><span class="annottext">is_ext :: InstalledModule -&gt; p -&gt; Bool
</span><a href="#local-6989586621680949893"><span class="hs-identifier hs-var hs-var">is_ext</span></a></span></span><span> </span><span id="local-6989586621680949888"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949888"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledModule -&gt; UnitId
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949888"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; Unit -&gt; Bool
</span><a href="GHC.Unit.Module.html#unitIdEq"><span class="hs-operator hs-var">`unitIdEq`</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949892"><span class="hs-identifier hs-var">this_pkg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-81"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="annot"><a href="GHC.Driver.Finder.html#addToFinderCache"><span class="hs-identifier hs-type">addToFinderCache</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FinderCache"><span class="hs-identifier hs-type">FinderCache</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-84"></span><span id="addToFinderCache"><span class="annot"><span class="annottext">addToFinderCache :: IORef FinderCache
-&gt; InstalledModule -&gt; InstalledFindResult -&gt; IO ()
</span><a href="GHC.Driver.Finder.html#addToFinderCache"><span class="hs-identifier hs-var hs-var">addToFinderCache</span></a></span></span><span> </span><span id="local-6989586621680949883"><span class="annot"><span class="annottext">IORef FinderCache
</span><a href="#local-6989586621680949883"><span class="hs-identifier hs-var">ref</span></a></span></span><span> </span><span id="local-6989586621680949882"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949882"><span class="hs-identifier hs-var">key</span></a></span></span><span> </span><span id="local-6989586621680949881"><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949881"><span class="hs-identifier hs-var">val</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-85"></span><span>  </span><span class="annot"><span class="annottext">IORef FinderCache -&gt; (FinderCache -&gt; (FinderCache, ())) -&gt; IO ()
forall a b. IORef a -&gt; (a -&gt; (a, b)) -&gt; IO b
</span><a href="../../base/src/GHC.IORef.html#atomicModifyIORef%27"><span class="hs-identifier hs-var">atomicModifyIORef'</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FinderCache
</span><a href="#local-6989586621680949883"><span class="hs-identifier hs-var">ref</span></a></span><span> </span><span class="annot"><span class="annottext">((FinderCache -&gt; (FinderCache, ())) -&gt; IO ())
-&gt; (FinderCache -&gt; (FinderCache, ())) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680949880"><span class="annot"><span class="annottext">FinderCache
</span><a href="#local-6989586621680949880"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FinderCache
-&gt; InstalledModule -&gt; InstalledFindResult -&gt; FinderCache
forall a.
InstalledModuleEnv a
-&gt; InstalledModule -&gt; a -&gt; InstalledModuleEnv a
</span><a href="GHC.Unit.Module.Env.html#extendInstalledModuleEnv"><span class="hs-identifier hs-var">extendInstalledModuleEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FinderCache
</span><a href="#local-6989586621680949880"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949882"><span class="hs-identifier hs-var">key</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949881"><span class="hs-identifier hs-var">val</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="annot"><a href="GHC.Driver.Finder.html#removeFromFinderCache"><span class="hs-identifier hs-type">removeFromFinderCache</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FinderCache"><span class="hs-identifier hs-type">FinderCache</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-88"></span><span id="removeFromFinderCache"><span class="annot"><span class="annottext">removeFromFinderCache :: IORef FinderCache -&gt; InstalledModule -&gt; IO ()
</span><a href="GHC.Driver.Finder.html#removeFromFinderCache"><span class="hs-identifier hs-var hs-var">removeFromFinderCache</span></a></span></span><span> </span><span id="local-6989586621680949877"><span class="annot"><span class="annottext">IORef FinderCache
</span><a href="#local-6989586621680949877"><span class="hs-identifier hs-var">ref</span></a></span></span><span> </span><span id="local-6989586621680949876"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949876"><span class="hs-identifier hs-var">key</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-89"></span><span>  </span><span class="annot"><span class="annottext">IORef FinderCache -&gt; (FinderCache -&gt; (FinderCache, ())) -&gt; IO ()
forall a b. IORef a -&gt; (a -&gt; (a, b)) -&gt; IO b
</span><a href="../../base/src/GHC.IORef.html#atomicModifyIORef%27"><span class="hs-identifier hs-var">atomicModifyIORef'</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FinderCache
</span><a href="#local-6989586621680949877"><span class="hs-identifier hs-var">ref</span></a></span><span> </span><span class="annot"><span class="annottext">((FinderCache -&gt; (FinderCache, ())) -&gt; IO ())
-&gt; (FinderCache -&gt; (FinderCache, ())) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680949875"><span class="annot"><span class="annottext">FinderCache
</span><a href="#local-6989586621680949875"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FinderCache -&gt; InstalledModule -&gt; FinderCache
forall a.
InstalledModuleEnv a -&gt; InstalledModule -&gt; InstalledModuleEnv a
</span><a href="GHC.Unit.Module.Env.html#delInstalledModuleEnv"><span class="hs-identifier hs-var">delInstalledModuleEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FinderCache
</span><a href="#local-6989586621680949875"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949876"><span class="hs-identifier hs-var">key</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="annot"><a href="GHC.Driver.Finder.html#lookupFinderCache"><span class="hs-identifier hs-type">lookupFinderCache</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FinderCache"><span class="hs-identifier hs-type">FinderCache</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span id="lookupFinderCache"><span class="annot"><span class="annottext">lookupFinderCache :: IORef FinderCache
-&gt; InstalledModule -&gt; IO (Maybe InstalledFindResult)
</span><a href="GHC.Driver.Finder.html#lookupFinderCache"><span class="hs-identifier hs-var hs-var">lookupFinderCache</span></a></span></span><span> </span><span id="local-6989586621680949872"><span class="annot"><span class="annottext">IORef FinderCache
</span><a href="#local-6989586621680949872"><span class="hs-identifier hs-var">ref</span></a></span></span><span> </span><span id="local-6989586621680949871"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949871"><span class="hs-identifier hs-var">key</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-93"></span><span>   </span><span id="local-6989586621680949870"><span class="annot"><span class="annottext">FinderCache
</span><a href="#local-6989586621680949870"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef FinderCache -&gt; IO FinderCache
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FinderCache
</span><a href="#local-6989586621680949872"><span class="hs-identifier hs-var">ref</span></a></span><span>
</span><span id="line-94"></span><span>   </span><span class="annot"><span class="annottext">Maybe InstalledFindResult -&gt; IO (Maybe InstalledFindResult)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe InstalledFindResult -&gt; IO (Maybe InstalledFindResult))
-&gt; Maybe InstalledFindResult -&gt; IO (Maybe InstalledFindResult)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">FinderCache -&gt; InstalledModule -&gt; Maybe InstalledFindResult
forall a. InstalledModuleEnv a -&gt; InstalledModule -&gt; Maybe a
</span><a href="GHC.Unit.Module.Env.html#lookupInstalledModuleEnv"><span class="hs-identifier hs-var">lookupInstalledModuleEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FinderCache
</span><a href="#local-6989586621680949870"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949871"><span class="hs-identifier hs-var">key</span></a></span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-97"></span><span class="hs-comment">-- The three external entry points</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-comment">-- | Locate a module that was imported by the user.  We have the</span><span>
</span><span id="line-100"></span><span class="hs-comment">-- module's name, and possibly a package name.  Without a package</span><span>
</span><span id="line-101"></span><span class="hs-comment">-- name, this function will use the search path and the known exposed</span><span>
</span><span id="line-102"></span><span class="hs-comment">-- packages to find the module, if a package is specified then only</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- that package is searched for the module.</span><span>
</span><span id="line-104"></span><span>
</span><span id="line-105"></span><span class="annot"><a href="GHC.Driver.Finder.html#findImportedModule"><span class="hs-identifier hs-type">findImportedModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span>
</span><span id="line-106"></span><span id="findImportedModule"><span class="annot"><span class="annottext">findImportedModule :: HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findImportedModule"><span class="hs-identifier hs-var hs-var">findImportedModule</span></a></span></span><span> </span><span id="local-6989586621680949867"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949867"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949866"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949866"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621680949865"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680949865"><span class="hs-identifier hs-var">mb_pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-107"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680949865"><span class="hs-identifier hs-var">mb_pkg</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-108"></span><span>        </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO FindResult
</span><a href="#local-6989586621680949864"><span class="hs-identifier hs-var">unqual_import</span></a></span><span>
</span><span id="line-109"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949863"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680949863"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680949863"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;this&quot;</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO FindResult
</span><a href="#local-6989586621680949861"><span class="hs-identifier hs-var">home_import</span></a></span><span> </span><span class="hs-comment">-- &quot;this&quot; is special</span><span>
</span><span id="line-110"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IO FindResult
</span><a href="#local-6989586621680949860"><span class="hs-identifier hs-var">pkg_import</span></a></span><span>
</span><span id="line-111"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-112"></span><span>    </span><span id="local-6989586621680949861"><span class="annot"><span class="annottext">home_import :: IO FindResult
</span><a href="#local-6989586621680949861"><span class="hs-identifier hs-var hs-var">home_import</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findHomeModule"><span class="hs-identifier hs-var">findHomeModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949867"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949866"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span>    </span><span id="local-6989586621680949860"><span class="annot"><span class="annottext">pkg_import :: IO FindResult
</span><a href="#local-6989586621680949860"><span class="hs-identifier hs-var hs-var">pkg_import</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findExposedPackageModule"><span class="hs-identifier hs-var">findExposedPackageModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949867"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949866"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680949865"><span class="hs-identifier hs-var">mb_pkg</span></a></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span>    </span><span id="local-6989586621680949864"><span class="annot"><span class="annottext">unqual_import :: IO FindResult
</span><a href="#local-6989586621680949864"><span class="hs-identifier hs-var hs-var">unqual_import</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO FindResult
</span><a href="#local-6989586621680949861"><span class="hs-identifier hs-var">home_import</span></a></span><span>
</span><span id="line-117"></span><span>                    </span><span class="annot"><span class="annottext">IO FindResult -&gt; IO FindResult -&gt; IO FindResult
forall (m :: * -&gt; *).
Monad m =&gt;
m FindResult -&gt; m FindResult -&gt; m FindResult
</span><a href="GHC.Driver.Finder.html#orIfNotFound"><span class="hs-operator hs-var">`orIfNotFound`</span></a></span><span>
</span><span id="line-118"></span><span>                    </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findExposedPackageModule"><span class="hs-identifier hs-var">findExposedPackageModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949867"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949866"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-119"></span><span>
</span><span id="line-120"></span><span class="hs-comment">-- | Locate a plugin module requested by the user, for a compiler</span><span>
</span><span id="line-121"></span><span class="hs-comment">-- plugin.  This consults the same set of exposed packages as</span><span>
</span><span id="line-122"></span><span class="hs-comment">-- 'findImportedModule', unless @-hide-all-plugin-packages@ or</span><span>
</span><span id="line-123"></span><span class="hs-comment">-- @-plugin-package@ are specified.</span><span>
</span><span id="line-124"></span><span class="annot"><a href="GHC.Driver.Finder.html#findPluginModule"><span class="hs-identifier hs-type">findPluginModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span>
</span><span id="line-125"></span><span id="findPluginModule"><span class="annot"><span class="annottext">findPluginModule :: HscEnv -&gt; ModuleName -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findPluginModule"><span class="hs-identifier hs-var hs-var">findPluginModule</span></a></span></span><span> </span><span id="local-6989586621680949857"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949857"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949856"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949856"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-126"></span><span>  </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findHomeModule"><span class="hs-identifier hs-var">findHomeModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949857"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949856"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-127"></span><span>  </span><span class="annot"><span class="annottext">IO FindResult -&gt; IO FindResult -&gt; IO FindResult
forall (m :: * -&gt; *).
Monad m =&gt;
m FindResult -&gt; m FindResult -&gt; m FindResult
</span><a href="GHC.Driver.Finder.html#orIfNotFound"><span class="hs-operator hs-var">`orIfNotFound`</span></a></span><span>
</span><span id="line-128"></span><span>  </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findExposedPluginPackageModule"><span class="hs-identifier hs-var">findExposedPluginPackageModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949857"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949856"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span class="hs-comment">-- | Locate a specific 'Module'.  The purpose of this function is to</span><span>
</span><span id="line-131"></span><span class="hs-comment">-- create a 'ModLocation' for a given 'Module', that is to find out</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- where the files associated with this module live.  It is used when</span><span>
</span><span id="line-133"></span><span class="hs-comment">-- reading the interface for a module mentioned by another interface,</span><span>
</span><span id="line-134"></span><span class="hs-comment">-- for example (a &quot;system import&quot;).</span><span>
</span><span id="line-135"></span><span>
</span><span id="line-136"></span><span class="annot"><a href="GHC.Driver.Finder.html#findExactModule"><span class="hs-identifier hs-type">findExactModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span>
</span><span id="line-137"></span><span id="findExactModule"><span class="annot"><span class="annottext">findExactModule :: HscEnv -&gt; InstalledModule -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findExactModule"><span class="hs-identifier hs-var hs-var">findExactModule</span></a></span></span><span> </span><span id="local-6989586621680949854"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949854"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949853"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949853"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-138"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949852"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621680949852"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949854"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-139"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">InstalledModule -&gt; UnitId
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949853"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; Unit -&gt; Bool
</span><a href="GHC.Unit.Module.html#unitIdEq"><span class="hs-operator hs-var">`unitIdEq`</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Unit
</span><a href="GHC.Driver.Session.html#homeUnit"><span class="hs-identifier hs-var">homeUnit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949852"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-140"></span><span>       </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findInstalledHomeModule"><span class="hs-identifier hs-var">findInstalledHomeModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949854"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledModule -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949853"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>       </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InstalledModule -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findPackageModule"><span class="hs-identifier hs-var">findPackageModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949854"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949853"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-144"></span><span class="hs-comment">-- Helpers</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-comment">-- | Given a monadic actions @this@ and @or_this@, first execute</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- @this@.  If the returned 'FindResult' is successful, return</span><span>
</span><span id="line-148"></span><span class="hs-comment">-- it; otherwise, execute @or_this@.  If both failed, this function</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- also combines their failure messages in a reasonable way.</span><span>
</span><span id="line-150"></span><span id="local-6989586621680950067"><span class="annot"><a href="GHC.Driver.Finder.html#orIfNotFound"><span class="hs-identifier hs-type">orIfNotFound</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680950067"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680950067"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680950067"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621680950067"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span></span><span>
</span><span id="line-151"></span><span id="orIfNotFound"><span class="annot"><span class="annottext">orIfNotFound :: forall (m :: * -&gt; *).
Monad m =&gt;
m FindResult -&gt; m FindResult -&gt; m FindResult
</span><a href="GHC.Driver.Finder.html#orIfNotFound"><span class="hs-identifier hs-var hs-var">orIfNotFound</span></a></span></span><span> </span><span id="local-6989586621680949842"><span class="annot"><span class="annottext">m FindResult
</span><a href="#local-6989586621680949842"><span class="hs-identifier hs-var">this</span></a></span></span><span> </span><span id="local-6989586621680949841"><span class="annot"><span class="annottext">m FindResult
</span><a href="#local-6989586621680949841"><span class="hs-identifier hs-var">or_this</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-152"></span><span>  </span><span id="local-6989586621680949840"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949840"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m FindResult
</span><a href="#local-6989586621680949842"><span class="hs-identifier hs-var">this</span></a></span><span>
</span><span id="line-153"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949840"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-154"></span><span>    </span><span class="annot"><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_paths :: FindResult -&gt; [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949837"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949837"><span class="hs-identifier hs-var">paths1</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: FindResult -&gt; [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949835"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949835"><span class="hs-identifier hs-var">mh1</span></a></span></span><span>
</span><span id="line-155"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: FindResult -&gt; [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949833"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949833"><span class="hs-identifier hs-var">ph1</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: FindResult -&gt; [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949831"><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949831"><span class="hs-identifier hs-var">u1</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_suggestions :: FindResult -&gt; [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949829"><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949829"><span class="hs-identifier hs-var">s1</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-156"></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680949828"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949828"><span class="hs-identifier hs-var">res2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m FindResult
</span><a href="#local-6989586621680949841"><span class="hs-identifier hs-var">or_this</span></a></span><span>
</span><span id="line-157"></span><span>           </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949828"><span class="hs-identifier hs-var">res2</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-158"></span><span>             </span><span class="annot"><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_paths :: FindResult -&gt; [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949827"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949827"><span class="hs-identifier hs-var">paths2</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkg :: FindResult -&gt; Maybe Unit
</span><a href="GHC.Driver.Types.html#fr_pkg"><span class="hs-identifier hs-var">fr_pkg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949825"><span class="annot"><span class="annottext">Maybe Unit
</span><a href="#local-6989586621680949825"><span class="hs-identifier hs-var">mb_pkg2</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: FindResult -&gt; [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949824"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949824"><span class="hs-identifier hs-var">mh2</span></a></span></span><span>
</span><span id="line-159"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: FindResult -&gt; [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949823"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949823"><span class="hs-identifier hs-var">ph2</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: FindResult -&gt; [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949822"><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949822"><span class="hs-identifier hs-var">u2</span></a></span></span><span>
</span><span id="line-160"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_suggestions :: FindResult -&gt; [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949821"><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949821"><span class="hs-identifier hs-var">s2</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-161"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FindResult -&gt; m FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NotFound :: [String]
-&gt; Maybe Unit
-&gt; [Unit]
-&gt; [Unit]
-&gt; [(Unit, UnusableUnitReason)]
-&gt; [ModuleSuggestion]
-&gt; FindResult
</span><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_paths :: [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949837"><span class="hs-identifier hs-var">paths1</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; [String] -&gt; [String]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949827"><span class="hs-identifier hs-var">paths2</span></a></span><span>
</span><span id="line-162"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkg :: Maybe Unit
</span><a href="GHC.Driver.Types.html#fr_pkg"><span class="hs-identifier hs-var">fr_pkg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Unit
</span><a href="#local-6989586621680949825"><span class="hs-identifier hs-var">mb_pkg2</span></a></span><span> </span><span class="hs-comment">-- snd arg is the package search</span><span>
</span><span id="line-163"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949835"><span class="hs-identifier hs-var">mh1</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit] -&gt; [Unit] -&gt; [Unit]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949824"><span class="hs-identifier hs-var">mh2</span></a></span><span>
</span><span id="line-164"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949833"><span class="hs-identifier hs-var">ph1</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit] -&gt; [Unit] -&gt; [Unit]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949823"><span class="hs-identifier hs-var">ph2</span></a></span><span>
</span><span id="line-165"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949831"><span class="hs-identifier hs-var">u1</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
-&gt; [(Unit, UnusableUnitReason)] -&gt; [(Unit, UnusableUnitReason)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949822"><span class="hs-identifier hs-var">u2</span></a></span><span>
</span><span id="line-166"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_suggestions :: [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949829"><span class="hs-identifier hs-var">s1</span></a></span><span>  </span><span class="annot"><span class="annottext">[ModuleSuggestion] -&gt; [ModuleSuggestion] -&gt; [ModuleSuggestion]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949821"><span class="hs-identifier hs-var">s2</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-167"></span><span>             </span><span id="local-6989586621680949820"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949820"><span class="hs-identifier hs-var">_other</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FindResult -&gt; m FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949828"><span class="hs-identifier hs-var">res2</span></a></span><span>
</span><span id="line-168"></span><span>    </span><span id="local-6989586621680949819"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949819"><span class="hs-identifier hs-var">_other</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FindResult -&gt; m FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949840"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="hs-comment">-- | Helper function for 'findHomeModule': this function wraps an IO action</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- which would look up @mod_name@ in the file system (the home package),</span><span>
</span><span id="line-172"></span><span class="hs-comment">-- and first consults the 'hsc_FC' cache to see if the lookup has already</span><span>
</span><span id="line-173"></span><span class="hs-comment">-- been done.  Otherwise, do the lookup (with the IO action) and save</span><span>
</span><span id="line-174"></span><span class="hs-comment">-- the result in the finder cache and the module location cache (if it</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- was successful.)</span><span>
</span><span id="line-176"></span><span class="annot"><a href="GHC.Driver.Finder.html#homeSearchCache"><span class="hs-identifier hs-type">homeSearchCache</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span>
</span><span id="line-177"></span><span id="homeSearchCache"><span class="annot"><span class="annottext">homeSearchCache :: HscEnv
-&gt; ModuleName -&gt; IO InstalledFindResult -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#homeSearchCache"><span class="hs-identifier hs-var hs-var">homeSearchCache</span></a></span></span><span> </span><span id="local-6989586621680949817"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949817"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949816"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949816"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621680949815"><span class="annot"><span class="annottext">IO InstalledFindResult
</span><a href="#local-6989586621680949815"><span class="hs-identifier hs-var">do_this</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-178"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949814"><span class="annot"><span class="annottext">mod :: InstalledModule
</span><a href="#local-6989586621680949814"><span class="hs-identifier hs-var hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; InstalledModule
</span><a href="GHC.Driver.Finder.html#mkHomeInstalledModule"><span class="hs-identifier hs-var">mkHomeInstalledModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949817"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949816"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-179"></span><span>  </span><span class="annot"><span class="annottext">HscEnv
-&gt; InstalledModule
-&gt; IO InstalledFindResult
-&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#modLocationCache"><span class="hs-identifier hs-var">modLocationCache</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949817"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949814"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">IO InstalledFindResult
</span><a href="#local-6989586621680949815"><span class="hs-identifier hs-var">do_this</span></a></span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="annot"><a href="GHC.Driver.Finder.html#findExposedPackageModule"><span class="hs-identifier hs-type">findExposedPackageModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-182"></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span>
</span><span id="line-183"></span><span id="findExposedPackageModule"><span class="annot"><span class="annottext">findExposedPackageModule :: HscEnv -&gt; ModuleName -&gt; Maybe FastString -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findExposedPackageModule"><span class="hs-identifier hs-var hs-var">findExposedPackageModule</span></a></span></span><span> </span><span id="local-6989586621680949811"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949811"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949810"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949810"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621680949809"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680949809"><span class="hs-identifier hs-var">mb_pkg</span></a></span></span><span>
</span><span id="line-184"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; LookupResult -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findLookupResult"><span class="hs-identifier hs-var">findLookupResult</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949811"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-185"></span><span>  </span><span class="annot"><span class="annottext">(LookupResult -&gt; IO FindResult) -&gt; LookupResult -&gt; IO FindResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; ModuleName -&gt; Maybe FastString -&gt; LookupResult
</span><a href="GHC.Unit.State.html#lookupModuleWithSuggestions"><span class="hs-identifier hs-var">lookupModuleWithSuggestions</span></a></span><span>
</span><span id="line-186"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949811"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949810"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680949809"><span class="hs-identifier hs-var">mb_pkg</span></a></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span class="annot"><a href="GHC.Driver.Finder.html#findExposedPluginPackageModule"><span class="hs-identifier hs-type">findExposedPluginPackageModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>
</span><span id="line-189"></span><span>                               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span>
</span><span id="line-190"></span><span id="findExposedPluginPackageModule"><span class="annot"><span class="annottext">findExposedPluginPackageModule :: HscEnv -&gt; ModuleName -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findExposedPluginPackageModule"><span class="hs-identifier hs-var hs-var">findExposedPluginPackageModule</span></a></span></span><span> </span><span id="local-6989586621680949805"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949805"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949804"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949804"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span>
</span><span id="line-191"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; LookupResult -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findLookupResult"><span class="hs-identifier hs-var">findLookupResult</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949805"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-192"></span><span>  </span><span class="annot"><span class="annottext">(LookupResult -&gt; IO FindResult) -&gt; LookupResult -&gt; IO FindResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; ModuleName -&gt; Maybe FastString -&gt; LookupResult
</span><a href="GHC.Unit.State.html#lookupPluginModuleWithSuggestions"><span class="hs-identifier hs-var">lookupPluginModuleWithSuggestions</span></a></span><span>
</span><span id="line-193"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949805"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949804"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="annot"><a href="GHC.Driver.Finder.html#findLookupResult"><span class="hs-identifier hs-type">findLookupResult</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.State.html#LookupResult"><span class="hs-identifier hs-type">LookupResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span>
</span><span id="line-196"></span><span id="findLookupResult"><span class="annot"><span class="annottext">findLookupResult :: HscEnv -&gt; LookupResult -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findLookupResult"><span class="hs-identifier hs-var hs-var">findLookupResult</span></a></span></span><span> </span><span id="local-6989586621680949802"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949802"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949801"><span class="annot"><span class="annottext">LookupResult
</span><a href="#local-6989586621680949801"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">LookupResult
</span><a href="#local-6989586621680949801"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-197"></span><span>     </span><span class="annot"><a href="GHC.Unit.State.html#LookupFound"><span class="hs-identifier hs-type">LookupFound</span></a></span><span> </span><span id="local-6989586621680949799"><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949799"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680949798"><span class="annot"><span class="annottext">(UnitInfo, ModuleOrigin)
</span><a href="#local-6989586621680949798"><span class="hs-identifier hs-var">pkg_conf</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-198"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949797"><span class="annot"><span class="annottext">im :: InstalledModule
</span><a href="#local-6989586621680949797"><span class="hs-identifier hs-var hs-var">im</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(InstalledModule, Maybe InstantiatedModule) -&gt; InstalledModule
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; (InstalledModule, Maybe InstantiatedModule)
</span><a href="GHC.Unit.Module.html#getModuleInstantiation"><span class="hs-identifier hs-var">getModuleInstantiation</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949799"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>       </span><span id="local-6989586621680949795"><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949795"><span class="hs-identifier hs-var">r'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InstalledModule -&gt; UnitInfo -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findPackageModule_"><span class="hs-identifier hs-var">findPackageModule_</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949802"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949797"><span class="hs-identifier hs-var">im</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(UnitInfo, ModuleOrigin) -&gt; UnitInfo
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">(UnitInfo, ModuleOrigin)
</span><a href="#local-6989586621680949798"><span class="hs-identifier hs-var">pkg_conf</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949795"><span class="hs-identifier hs-var">r'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-201"></span><span>        </span><span class="hs-comment">-- TODO: ghc -M is unlikely to do the right thing</span><span>
</span><span id="line-202"></span><span>        </span><span class="hs-comment">-- with just the location of the thing that was</span><span>
</span><span id="line-203"></span><span>        </span><span class="hs-comment">-- instantiated; you probably also need all of the</span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-comment">-- implicit locations from the instances</span><span>
</span><span id="line-205"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFound"><span class="hs-identifier hs-type">InstalledFound</span></a></span><span> </span><span id="local-6989586621680949792"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949792"><span class="hs-identifier hs-var">loc</span></a></span></span><span>   </span><span class="annot"><span class="annottext">InstalledModule
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FindResult -&gt; IO FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; GenModule Unit -&gt; FindResult
</span><a href="GHC.Driver.Types.html#Found"><span class="hs-identifier hs-var">Found</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949792"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949799"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-206"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledNoPackage"><span class="hs-identifier hs-type">InstalledNoPackage</span></a></span><span>   </span><span class="annot"><span class="annottext">UnitId
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FindResult -&gt; IO FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; FindResult
</span><a href="GHC.Driver.Types.html#NoPackage"><span class="hs-identifier hs-var">NoPackage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949799"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledNotFound"><span class="hs-identifier hs-type">InstalledNotFound</span></a></span><span> </span><span id="local-6989586621680949787"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949787"><span class="hs-identifier hs-var">fp</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe UnitId
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FindResult -&gt; IO FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NotFound :: [String]
-&gt; Maybe Unit
-&gt; [Unit]
-&gt; [Unit]
-&gt; [(Unit, UnusableUnitReason)]
-&gt; [ModuleSuggestion]
-&gt; FindResult
</span><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_paths :: [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949787"><span class="hs-identifier hs-var">fp</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkg :: Maybe Unit
</span><a href="GHC.Driver.Types.html#fr_pkg"><span class="hs-identifier hs-var">fr_pkg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unit -&gt; Maybe Unit
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949799"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-208"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-209"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-210"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-211"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_suggestions :: [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-212"></span><span>     </span><span class="annot"><a href="GHC.Unit.State.html#LookupMultiple"><span class="hs-identifier hs-type">LookupMultiple</span></a></span><span> </span><span id="local-6989586621680949785"><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949785"><span class="hs-identifier hs-var">rs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-213"></span><span>       </span><span class="annot"><span class="annottext">FindResult -&gt; IO FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)] -&gt; FindResult
</span><a href="GHC.Driver.Types.html#FoundMultiple"><span class="hs-identifier hs-var">FoundMultiple</span></a></span><span> </span><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949785"><span class="hs-identifier hs-var">rs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-214"></span><span>     </span><span class="annot"><a href="GHC.Unit.State.html#LookupHidden"><span class="hs-identifier hs-type">LookupHidden</span></a></span><span> </span><span id="local-6989586621680949782"><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949782"><span class="hs-identifier hs-var">pkg_hiddens</span></a></span></span><span> </span><span id="local-6989586621680949781"><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949781"><span class="hs-identifier hs-var">mod_hiddens</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-215"></span><span>       </span><span class="annot"><span class="annottext">FindResult -&gt; IO FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NotFound :: [String]
-&gt; Maybe Unit
-&gt; [Unit]
-&gt; [Unit]
-&gt; [(Unit, UnusableUnitReason)]
-&gt; [ModuleSuggestion]
-&gt; FindResult
</span><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_paths :: [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkg :: Maybe Unit
</span><a href="GHC.Driver.Types.html#fr_pkg"><span class="hs-identifier hs-var">fr_pkg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Unit
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-216"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((GenModule Unit, ModuleOrigin) -&gt; Unit)
-&gt; [(GenModule Unit, ModuleOrigin)] -&gt; [Unit]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span class="annot"><span class="annottext">(GenModule Unit -&gt; Unit)
-&gt; ((GenModule Unit, ModuleOrigin) -&gt; GenModule Unit)
-&gt; (GenModule Unit, ModuleOrigin)
-&gt; Unit
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">(GenModule Unit, ModuleOrigin) -&gt; GenModule Unit
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949782"><span class="hs-identifier hs-var">pkg_hiddens</span></a></span><span>
</span><span id="line-217"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((GenModule Unit, ModuleOrigin) -&gt; Unit)
-&gt; [(GenModule Unit, ModuleOrigin)] -&gt; [Unit]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span class="annot"><span class="annottext">(GenModule Unit -&gt; Unit)
-&gt; ((GenModule Unit, ModuleOrigin) -&gt; GenModule Unit)
-&gt; (GenModule Unit, ModuleOrigin)
-&gt; Unit
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">(GenModule Unit, ModuleOrigin) -&gt; GenModule Unit
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949781"><span class="hs-identifier hs-var">mod_hiddens</span></a></span><span>
</span><span id="line-218"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-219"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_suggestions :: [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-220"></span><span>     </span><span class="annot"><a href="GHC.Unit.State.html#LookupUnusable"><span class="hs-identifier hs-type">LookupUnusable</span></a></span><span> </span><span id="local-6989586621680949778"><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949778"><span class="hs-identifier hs-var">unusable</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-221"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949777"><span class="annot"><span class="annottext">unusables' :: [(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949777"><span class="hs-identifier hs-var hs-var">unusables'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((GenModule Unit, ModuleOrigin) -&gt; (Unit, UnusableUnitReason))
-&gt; [(GenModule Unit, ModuleOrigin)] -&gt; [(Unit, UnusableUnitReason)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(GenModule Unit, ModuleOrigin) -&gt; (Unit, UnusableUnitReason)
forall {a}. (GenModule a, ModuleOrigin) -&gt; (a, UnusableUnitReason)
</span><a href="#local-6989586621680949776"><span class="hs-identifier hs-var">get_unusable</span></a></span><span> </span><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949778"><span class="hs-identifier hs-var">unusable</span></a></span><span>
</span><span id="line-222"></span><span>           </span><span id="local-6989586621680949776"><span class="annot"><span class="annottext">get_unusable :: (GenModule a, ModuleOrigin) -&gt; (a, UnusableUnitReason)
</span><a href="#local-6989586621680949776"><span class="hs-identifier hs-var hs-var">get_unusable</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680949771"><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949771"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.State.html#ModUnusable"><span class="hs-identifier hs-type">ModUnusable</span></a></span><span> </span><span id="local-6989586621680949769"><span class="annot"><span class="annottext">UnusableUnitReason
</span><a href="#local-6989586621680949769"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule a -&gt; a
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949771"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">UnusableUnitReason
</span><a href="#local-6989586621680949769"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-223"></span><span>           </span><span class="annot"><a href="#local-6989586621680949776"><span class="hs-identifier hs-var">get_unusable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680949768"><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="#local-6989586621680949768"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span>             </span><span class="hs-glyph">=</span><span>
</span><span id="line-224"></span><span>             </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (a, UnusableUnitReason)
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;findLookupResult: unexpected origin&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleOrigin -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="#local-6989586621680949768"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-225"></span><span>       </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">FindResult -&gt; IO FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NotFound :: [String]
-&gt; Maybe Unit
-&gt; [Unit]
-&gt; [Unit]
-&gt; [(Unit, UnusableUnitReason)]
-&gt; [ModuleSuggestion]
-&gt; FindResult
</span><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_paths :: [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkg :: Maybe Unit
</span><a href="GHC.Driver.Types.html#fr_pkg"><span class="hs-identifier hs-var">fr_pkg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Unit
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-226"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-227"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-228"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949777"><span class="hs-identifier hs-var">unusables'</span></a></span><span>
</span><span id="line-229"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_suggestions :: [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-230"></span><span>     </span><span class="annot"><a href="GHC.Unit.State.html#LookupNotFound"><span class="hs-identifier hs-type">LookupNotFound</span></a></span><span> </span><span id="local-6989586621680949764"><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949764"><span class="hs-identifier hs-var">suggest</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-231"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949763"><span class="annot"><span class="annottext">suggest' :: [ModuleSuggestion]
</span><a href="#local-6989586621680949763"><span class="hs-identifier hs-var hs-var">suggest'</span></a></span></span><span>
</span><span id="line-232"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_HelpfulErrors"><span class="hs-identifier hs-var">Opt_HelpfulErrors</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949802"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949764"><span class="hs-identifier hs-var">suggest</span></a></span><span>
</span><span id="line-233"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-234"></span><span>       </span><span class="annot"><span class="annottext">FindResult -&gt; IO FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NotFound :: [String]
-&gt; Maybe Unit
-&gt; [Unit]
-&gt; [Unit]
-&gt; [(Unit, UnusableUnitReason)]
-&gt; [ModuleSuggestion]
-&gt; FindResult
</span><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_paths :: [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkg :: Maybe Unit
</span><a href="GHC.Driver.Types.html#fr_pkg"><span class="hs-identifier hs-var">fr_pkg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Unit
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-235"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-236"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-237"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-238"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_suggestions :: [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949763"><span class="hs-identifier hs-var">suggest'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-239"></span><span>
</span><span id="line-240"></span><span class="annot"><a href="GHC.Driver.Finder.html#modLocationCache"><span class="hs-identifier hs-type">modLocationCache</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span>
</span><span id="line-241"></span><span id="modLocationCache"><span class="annot"><span class="annottext">modLocationCache :: HscEnv
-&gt; InstalledModule
-&gt; IO InstalledFindResult
-&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#modLocationCache"><span class="hs-identifier hs-var hs-var">modLocationCache</span></a></span></span><span> </span><span id="local-6989586621680949760"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949760"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949759"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949759"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949758"><span class="annot"><span class="annottext">IO InstalledFindResult
</span><a href="#local-6989586621680949758"><span class="hs-identifier hs-var">do_this</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-242"></span><span>  </span><span id="local-6989586621680949757"><span class="annot"><span class="annottext">Maybe InstalledFindResult
</span><a href="#local-6989586621680949757"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef FinderCache
-&gt; InstalledModule -&gt; IO (Maybe InstalledFindResult)
</span><a href="GHC.Driver.Finder.html#lookupFinderCache"><span class="hs-identifier hs-var">lookupFinderCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; IORef FinderCache
</span><a href="GHC.Driver.Types.html#hsc_FC"><span class="hs-identifier hs-var hs-var">hsc_FC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949760"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949759"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-243"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe InstalledFindResult
</span><a href="#local-6989586621680949757"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-244"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949756"><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949756"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949756"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-245"></span><span>    </span><span class="annot"><span class="annottext">Maybe InstalledFindResult
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-246"></span><span>        </span><span id="local-6989586621680949755"><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949755"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO InstalledFindResult
</span><a href="#local-6989586621680949758"><span class="hs-identifier hs-var">do_this</span></a></span><span>
</span><span id="line-247"></span><span>        </span><span class="annot"><span class="annottext">IORef FinderCache
-&gt; InstalledModule -&gt; InstalledFindResult -&gt; IO ()
</span><a href="GHC.Driver.Finder.html#addToFinderCache"><span class="hs-identifier hs-var">addToFinderCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; IORef FinderCache
</span><a href="GHC.Driver.Types.html#hsc_FC"><span class="hs-identifier hs-var hs-var">hsc_FC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949760"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949759"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949755"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-248"></span><span>        </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949755"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-249"></span><span>
</span><span id="line-250"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkHomeInstalledModule"><span class="hs-identifier hs-type">mkHomeInstalledModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span>
</span><span id="line-251"></span><span id="mkHomeInstalledModule"><span class="annot"><span class="annottext">mkHomeInstalledModule :: DynFlags -&gt; ModuleName -&gt; InstalledModule
</span><a href="GHC.Driver.Finder.html#mkHomeInstalledModule"><span class="hs-identifier hs-var hs-var">mkHomeInstalledModule</span></a></span></span><span> </span><span id="local-6989586621680949754"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949754"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949753"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949753"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-252"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949752"><span class="annot"><span class="annottext">iuid :: UnitId
</span><a href="#local-6989586621680949752"><span class="hs-identifier hs-var hs-var">iuid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitId
</span><a href="GHC.Driver.Session.html#homeUnitId"><span class="hs-identifier hs-var hs-var">homeUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949754"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-253"></span><span>  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; ModuleName -&gt; InstalledModule
forall unit. unit -&gt; ModuleName -&gt; GenModule unit
</span><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-var">Module</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949752"><span class="hs-identifier hs-var">iuid</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949753"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-254"></span><span>
</span><span id="line-255"></span><span class="hs-comment">-- This returns a module because it's more convenient for users</span><span>
</span><span id="line-256"></span><span class="annot"><a href="GHC.Driver.Finder.html#addHomeModuleToFinder"><span class="hs-identifier hs-type">addHomeModuleToFinder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-257"></span><span id="addHomeModuleToFinder"><span class="annot"><span class="annottext">addHomeModuleToFinder :: HscEnv -&gt; ModuleName -&gt; ModLocation -&gt; IO (GenModule Unit)
</span><a href="GHC.Driver.Finder.html#addHomeModuleToFinder"><span class="hs-identifier hs-var hs-var">addHomeModuleToFinder</span></a></span></span><span> </span><span id="local-6989586621680949748"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949748"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949747"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949747"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621680949746"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949746"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949745"><span class="annot"><span class="annottext">mod :: InstalledModule
</span><a href="#local-6989586621680949745"><span class="hs-identifier hs-var hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; InstalledModule
</span><a href="GHC.Driver.Finder.html#mkHomeInstalledModule"><span class="hs-identifier hs-var">mkHomeInstalledModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949748"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949747"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-259"></span><span>  </span><span class="annot"><span class="annottext">IORef FinderCache
-&gt; InstalledModule -&gt; InstalledFindResult -&gt; IO ()
</span><a href="GHC.Driver.Finder.html#addToFinderCache"><span class="hs-identifier hs-var">addToFinderCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; IORef FinderCache
</span><a href="GHC.Driver.Types.html#hsc_FC"><span class="hs-identifier hs-var hs-var">hsc_FC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949748"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949745"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; InstalledModule -&gt; InstalledFindResult
</span><a href="GHC.Driver.Types.html#InstalledFound"><span class="hs-identifier hs-var">InstalledFound</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949746"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949745"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span>  </span><span class="annot"><span class="annottext">GenModule Unit -&gt; IO (GenModule Unit)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; GenModule Unit
</span><a href="GHC.Driver.Session.html#mkHomeModule"><span class="hs-identifier hs-var">mkHomeModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949748"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949747"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="annot"><a href="GHC.Driver.Finder.html#uncacheModule"><span class="hs-identifier hs-type">uncacheModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-263"></span><span id="uncacheModule"><span class="annot"><span class="annottext">uncacheModule :: HscEnv -&gt; ModuleName -&gt; IO ()
</span><a href="GHC.Driver.Finder.html#uncacheModule"><span class="hs-identifier hs-var hs-var">uncacheModule</span></a></span></span><span> </span><span id="local-6989586621680949743"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949743"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949742"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949742"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-264"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949741"><span class="annot"><span class="annottext">mod :: InstalledModule
</span><a href="#local-6989586621680949741"><span class="hs-identifier hs-var hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; InstalledModule
</span><a href="GHC.Driver.Finder.html#mkHomeInstalledModule"><span class="hs-identifier hs-var">mkHomeInstalledModule</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949743"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949742"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-265"></span><span>  </span><span class="annot"><span class="annottext">IORef FinderCache -&gt; InstalledModule -&gt; IO ()
</span><a href="GHC.Driver.Finder.html#removeFromFinderCache"><span class="hs-identifier hs-var">removeFromFinderCache</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; IORef FinderCache
</span><a href="GHC.Driver.Types.html#hsc_FC"><span class="hs-identifier hs-var hs-var">hsc_FC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949743"><span class="hs-identifier hs-var">hsc_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949741"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-266"></span><span>
</span><span id="line-267"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-268"></span><span class="hs-comment">--      The internal workers</span><span>
</span><span id="line-269"></span><span>
</span><span id="line-270"></span><span class="annot"><a href="GHC.Driver.Finder.html#findHomeModule"><span class="hs-identifier hs-type">findHomeModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span>
</span><span id="line-271"></span><span id="findHomeModule"><span class="annot"><span class="annottext">findHomeModule :: HscEnv -&gt; ModuleName -&gt; IO FindResult
</span><a href="GHC.Driver.Finder.html#findHomeModule"><span class="hs-identifier hs-var hs-var">findHomeModule</span></a></span></span><span> </span><span id="local-6989586621680949740"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949740"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949739"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949739"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-272"></span><span>  </span><span id="local-6989586621680949738"><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949738"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; ModuleName -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findInstalledHomeModule"><span class="hs-identifier hs-var">findInstalledHomeModule</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949740"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949739"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-273"></span><span>  </span><span class="annot"><span class="annottext">FindResult -&gt; IO FindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(FindResult -&gt; IO FindResult) -&gt; FindResult -&gt; IO FindResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949738"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-274"></span><span>    </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFound"><span class="hs-identifier hs-type">InstalledFound</span></a></span><span> </span><span id="local-6989586621680949737"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949737"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ModLocation -&gt; GenModule Unit -&gt; FindResult
</span><a href="GHC.Driver.Types.html#Found"><span class="hs-identifier hs-var">Found</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949737"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; ModuleName -&gt; GenModule Unit
forall unit. unit -&gt; ModuleName -&gt; GenModule unit
</span><a href="GHC.Unit.Types.html#mkModule"><span class="hs-identifier hs-var">mkModule</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949735"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949739"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span>    </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledNoPackage"><span class="hs-identifier hs-type">InstalledNoPackage</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Unit -&gt; FindResult
</span><a href="GHC.Driver.Types.html#NoPackage"><span class="hs-identifier hs-var">NoPackage</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949735"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="hs-comment">-- impossible</span><span>
</span><span id="line-276"></span><span>    </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledNotFound"><span class="hs-identifier hs-type">InstalledNotFound</span></a></span><span> </span><span id="local-6989586621680949734"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949734"><span class="hs-identifier hs-var">fps</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe UnitId
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NotFound :: [String]
-&gt; Maybe Unit
-&gt; [Unit]
-&gt; [Unit]
-&gt; [(Unit, UnusableUnitReason)]
-&gt; [ModuleSuggestion]
-&gt; FindResult
</span><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-277"></span><span>        </span><span class="annot"><span class="annottext">fr_paths :: [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949734"><span class="hs-identifier hs-var">fps</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-278"></span><span>        </span><span class="annot"><span class="annottext">fr_pkg :: Maybe Unit
</span><a href="GHC.Driver.Types.html#fr_pkg"><span class="hs-identifier hs-var">fr_pkg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unit -&gt; Maybe Unit
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949735"><span class="hs-identifier hs-var">uid</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-279"></span><span>        </span><span class="annot"><span class="annottext">fr_mods_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-280"></span><span>        </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-281"></span><span>        </span><span class="annot"><span class="annottext">fr_unusables :: [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-282"></span><span>        </span><span class="annot"><span class="annottext">fr_suggestions :: [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-283"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-284"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-285"></span><span>  </span><span id="local-6989586621680949733"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621680949733"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949740"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-286"></span><span>  </span><span id="local-6989586621680949735"><span class="annot"><span class="annottext">uid :: Unit
</span><a href="#local-6989586621680949735"><span class="hs-identifier hs-var hs-var">uid</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Unit
</span><a href="GHC.Driver.Session.html#homeUnit"><span class="hs-identifier hs-var">homeUnit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949733"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-287"></span><span>
</span><span id="line-288"></span><span class="hs-comment">-- | Implements the search for a module name in the home package only.  Calling</span><span>
</span><span id="line-289"></span><span class="hs-comment">-- this function directly is usually *not* what you want; currently, it's used</span><span>
</span><span id="line-290"></span><span class="hs-comment">-- as a building block for the following operations:</span><span>
</span><span id="line-291"></span><span class="hs-comment">--</span><span>
</span><span id="line-292"></span><span class="hs-comment">--  1. When you do a normal package lookup, we first check if the module</span><span>
</span><span id="line-293"></span><span class="hs-comment">--  is available in the home module, before looking it up in the package</span><span>
</span><span id="line-294"></span><span class="hs-comment">--  database.</span><span>
</span><span id="line-295"></span><span class="hs-comment">--</span><span>
</span><span id="line-296"></span><span class="hs-comment">--  2. When you have a package qualified import with package name &quot;this&quot;,</span><span>
</span><span id="line-297"></span><span class="hs-comment">--  we shortcut to the home module.</span><span>
</span><span id="line-298"></span><span class="hs-comment">--</span><span>
</span><span id="line-299"></span><span class="hs-comment">--  3. When we look up an exact 'Module', if the unit id associated with</span><span>
</span><span id="line-300"></span><span class="hs-comment">--  the module is the current home module do a look up in the home module.</span><span>
</span><span id="line-301"></span><span class="hs-comment">--</span><span>
</span><span id="line-302"></span><span class="hs-comment">--  4. Some special-case code in GHCi (ToDo: Figure out why that needs to</span><span>
</span><span id="line-303"></span><span class="hs-comment">--  call this.)</span><span>
</span><span id="line-304"></span><span class="annot"><a href="GHC.Driver.Finder.html#findInstalledHomeModule"><span class="hs-identifier hs-type">findInstalledHomeModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span>
</span><span id="line-305"></span><span id="findInstalledHomeModule"><span class="annot"><span class="annottext">findInstalledHomeModule :: HscEnv -&gt; ModuleName -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findInstalledHomeModule"><span class="hs-identifier hs-var hs-var">findInstalledHomeModule</span></a></span></span><span> </span><span id="local-6989586621680949732"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949732"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949731"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-306"></span><span>   </span><span class="annot"><span class="annottext">HscEnv
-&gt; ModuleName -&gt; IO InstalledFindResult -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#homeSearchCache"><span class="hs-identifier hs-var">homeSearchCache</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949732"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">(IO InstalledFindResult -&gt; IO InstalledFindResult)
-&gt; IO InstalledFindResult -&gt; IO InstalledFindResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-307"></span><span>   </span><span class="hs-keyword">let</span><span>
</span><span id="line-308"></span><span>     </span><span id="local-6989586621680949730"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949732"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-309"></span><span>     </span><span id="local-6989586621680949729"><span class="annot"><span class="annottext">home_path :: [String]
</span><a href="#local-6989586621680949729"><span class="hs-identifier hs-var hs-var">home_path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [String]
</span><a href="GHC.Driver.Session.html#importPaths"><span class="hs-identifier hs-var hs-var">importPaths</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-310"></span><span>     </span><span id="local-6989586621680949727"><span class="annot"><span class="annottext">hisuf :: String
</span><a href="#local-6989586621680949727"><span class="hs-identifier hs-var hs-var">hisuf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String
</span><a href="GHC.Driver.Session.html#hiSuf"><span class="hs-identifier hs-var hs-var">hiSuf</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-311"></span><span>     </span><span id="local-6989586621680949725"><span class="annot"><span class="annottext">mod :: InstalledModule
</span><a href="#local-6989586621680949725"><span class="hs-identifier hs-var hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; InstalledModule
</span><a href="GHC.Driver.Finder.html#mkHomeInstalledModule"><span class="hs-identifier hs-var">mkHomeInstalledModule</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span>     </span><span id="local-6989586621680949724"><span class="annot"><span class="annottext">source_exts :: [(String, String -&gt; String -&gt; IO ModLocation)]
</span><a href="#local-6989586621680949724"><span class="hs-identifier hs-var hs-var">source_exts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-314"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;hs&quot;</span></span><span class="hs-special">,</span><span>   </span><span class="annot"><span class="annottext">DynFlags
-&gt; ModuleName -&gt; String -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocationSearched"><span class="hs-identifier hs-var">mkHomeModLocationSearched</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;hs&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-315"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lhs&quot;</span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">DynFlags
-&gt; ModuleName -&gt; String -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocationSearched"><span class="hs-identifier hs-var">mkHomeModLocationSearched</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lhs&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-316"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;hsig&quot;</span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">DynFlags
-&gt; ModuleName -&gt; String -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocationSearched"><span class="hs-identifier hs-var">mkHomeModLocationSearched</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;hsig&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-317"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lhsig&quot;</span></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">DynFlags
-&gt; ModuleName -&gt; String -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocationSearched"><span class="hs-identifier hs-var">mkHomeModLocationSearched</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;lhsig&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-318"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span>     </span><span class="hs-comment">-- we use mkHomeModHiOnlyLocation instead of mkHiOnlyModLocation so that</span><span>
</span><span id="line-321"></span><span>     </span><span class="hs-comment">-- when hiDir field is set in dflags, we know to look there (see #16500)</span><span>
</span><span id="line-322"></span><span>     </span><span id="local-6989586621680949722"><span class="annot"><span class="annottext">hi_exts :: [(String, String -&gt; String -&gt; IO ModLocation)]
</span><a href="#local-6989586621680949722"><span class="hs-identifier hs-var hs-var">hi_exts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949727"><span class="hs-identifier hs-var">hisuf</span></a></span><span class="hs-special">,</span><span>                </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModHiOnlyLocation"><span class="hs-identifier hs-var">mkHomeModHiOnlyLocation</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-323"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="GHC.Unit.Module.Location.html#addBootSuffix"><span class="hs-identifier hs-var">addBootSuffix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949727"><span class="hs-identifier hs-var">hisuf</span></a></span><span class="hs-special">,</span><span>  </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModHiOnlyLocation"><span class="hs-identifier hs-var">mkHomeModHiOnlyLocation</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949731"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-324"></span><span>               </span><span class="hs-special">]</span><span>
</span><span id="line-325"></span><span>
</span><span id="line-326"></span><span>        </span><span class="hs-comment">-- In compilation manager modes, we look for source files in the home</span><span>
</span><span id="line-327"></span><span>        </span><span class="hs-comment">-- package because we can compile these automatically.  In one-shot</span><span>
</span><span id="line-328"></span><span>        </span><span class="hs-comment">-- compilation mode we look for .hi and .hi-boot files only.</span><span>
</span><span id="line-329"></span><span>     </span><span id="local-6989586621680949719"><span class="annot"><span class="annottext">exts :: [(String, String -&gt; String -&gt; IO ModLocation)]
</span><a href="#local-6989586621680949719"><span class="hs-identifier hs-var hs-var">exts</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GhcMode -&gt; Bool
</span><a href="GHC.Driver.Session.html#isOneShot"><span class="hs-identifier hs-var">isOneShot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; GhcMode
</span><a href="GHC.Driver.Session.html#ghcMode"><span class="hs-identifier hs-var hs-var">ghcMode</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949730"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, String -&gt; String -&gt; IO ModLocation)]
</span><a href="#local-6989586621680949722"><span class="hs-identifier hs-var">hi_exts</span></a></span><span>
</span><span id="line-330"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(String, String -&gt; String -&gt; IO ModLocation)]
</span><a href="#local-6989586621680949724"><span class="hs-identifier hs-var">source_exts</span></a></span><span>
</span><span id="line-331"></span><span>   </span><span class="hs-keyword">in</span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span>  </span><span class="hs-comment">-- special case for GHC.Prim; we won't find it in the filesystem.</span><span>
</span><span id="line-334"></span><span>  </span><span class="hs-comment">-- This is important only when compiling the base package (where GHC.Prim</span><span>
</span><span id="line-335"></span><span>  </span><span class="hs-comment">-- is a home module).</span><span>
</span><span id="line-336"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949725"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule -&gt; GenModule Unit -&gt; Bool
</span><a href="GHC.Unit.Module.html#installedModuleEq"><span class="hs-operator hs-var">`installedModuleEq`</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="GHC.Builtin.Names.html#gHC_PRIM"><span class="hs-identifier hs-var">gHC_PRIM</span></a></span><span>
</span><span id="line-337"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; InstalledModule -&gt; InstalledFindResult
</span><a href="GHC.Driver.Types.html#InstalledFound"><span class="hs-identifier hs-var">InstalledFound</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ModLocation
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.Prim ModLocation&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949725"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-338"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[String]
-&gt; InstalledModule
-&gt; [(String, String -&gt; String -&gt; IO ModLocation)]
-&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#searchPathExts"><span class="hs-identifier hs-var">searchPathExts</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949729"><span class="hs-identifier hs-var">home_path</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949725"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, String -&gt; String -&gt; IO ModLocation)]
</span><a href="#local-6989586621680949719"><span class="hs-identifier hs-var">exts</span></a></span><span>
</span><span id="line-339"></span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span class="hs-comment">-- | Search for a module in external packages only.</span><span>
</span><span id="line-342"></span><span class="annot"><a href="GHC.Driver.Finder.html#findPackageModule"><span class="hs-identifier hs-type">findPackageModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span>
</span><span id="line-343"></span><span id="findPackageModule"><span class="annot"><span class="annottext">findPackageModule :: HscEnv -&gt; InstalledModule -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findPackageModule"><span class="hs-identifier hs-var hs-var">findPackageModule</span></a></span></span><span> </span><span id="local-6989586621680949713"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949713"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949712"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949712"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-344"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-345"></span><span>        </span><span id="local-6989586621680949711"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621680949711"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949713"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-346"></span><span>        </span><span id="local-6989586621680949710"><span class="annot"><span class="annottext">pkg_id :: UnitId
</span><a href="#local-6989586621680949710"><span class="hs-identifier hs-var hs-var">pkg_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstalledModule -&gt; UnitId
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949712"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-347"></span><span>        </span><span id="local-6989586621680949709"><span class="annot"><span class="annottext">pkgstate :: UnitState
</span><a href="#local-6989586621680949709"><span class="hs-identifier hs-var hs-var">pkgstate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949711"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-348"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-349"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; UnitId -&gt; Maybe UnitInfo
</span><a href="GHC.Unit.State.html#lookupUnitId"><span class="hs-identifier hs-var">lookupUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621680949709"><span class="hs-identifier hs-var">pkgstate</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949710"><span class="hs-identifier hs-var">pkg_id</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-350"></span><span>     </span><span class="annot"><span class="annottext">Maybe UnitInfo
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; InstalledFindResult
</span><a href="GHC.Driver.Types.html#InstalledNoPackage"><span class="hs-identifier hs-var">InstalledNoPackage</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949710"><span class="hs-identifier hs-var">pkg_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span>     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949707"><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949707"><span class="hs-identifier hs-var">pkg_conf</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InstalledModule -&gt; UnitInfo -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findPackageModule_"><span class="hs-identifier hs-var">findPackageModule_</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949713"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949712"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949707"><span class="hs-identifier hs-var">pkg_conf</span></a></span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span class="hs-comment">-- | Look up the interface file associated with module @mod@.  This function</span><span>
</span><span id="line-354"></span><span class="hs-comment">-- requires a few invariants to be upheld: (1) the 'Module' in question must</span><span>
</span><span id="line-355"></span><span class="hs-comment">-- be the module identifier of the *original* implementation of a module,</span><span>
</span><span id="line-356"></span><span class="hs-comment">-- not a reexport (this invariant is upheld by &quot;GHC.Unit.State&quot;) and (2)</span><span>
</span><span id="line-357"></span><span class="hs-comment">-- the 'UnitInfo' must be consistent with the unit id in the 'Module'.</span><span>
</span><span id="line-358"></span><span class="hs-comment">-- The redundancy is to avoid an extra lookup in the package state</span><span>
</span><span id="line-359"></span><span class="hs-comment">-- for the appropriate config.</span><span>
</span><span id="line-360"></span><span class="annot"><a href="GHC.Driver.Finder.html#findPackageModule_"><span class="hs-identifier hs-type">findPackageModule_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Info.html#UnitInfo"><span class="hs-identifier hs-type">UnitInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span>
</span><span id="line-361"></span><span id="findPackageModule_"><span class="annot"><span class="annottext">findPackageModule_ :: HscEnv -&gt; InstalledModule -&gt; UnitInfo -&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#findPackageModule_"><span class="hs-identifier hs-var hs-var">findPackageModule_</span></a></span></span><span> </span><span id="local-6989586621680949706"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949706"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621680949705"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949705"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949704"><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949704"><span class="hs-identifier hs-var">pkg_conf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-362"></span><span>  </span><span class="hs-identifier">ASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">moduleUnit</span><span> </span><span class="hs-identifier">mod</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">unitId</span><span> </span><span class="hs-identifier">pkg_conf</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">moduleUnit</span><span> </span><span class="hs-identifier">mod</span><span class="hs-special">)</span><span> </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">unitId</span><span> </span><span class="hs-identifier">pkg_conf</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-363"></span><span>  </span><span class="annot"><span class="annottext">HscEnv
-&gt; InstalledModule
-&gt; IO InstalledFindResult
-&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#modLocationCache"><span class="hs-identifier hs-var">modLocationCache</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949706"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949705"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">(IO InstalledFindResult -&gt; IO InstalledFindResult)
-&gt; IO InstalledFindResult -&gt; IO InstalledFindResult
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span>  </span><span class="hs-comment">-- special case for GHC.Prim; we won't find it in the filesystem.</span><span>
</span><span id="line-366"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949705"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule -&gt; GenModule Unit -&gt; Bool
</span><a href="GHC.Unit.Module.html#installedModuleEq"><span class="hs-operator hs-var">`installedModuleEq`</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="GHC.Builtin.Names.html#gHC_PRIM"><span class="hs-identifier hs-var">gHC_PRIM</span></a></span><span>
</span><span id="line-367"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; InstalledModule -&gt; InstalledFindResult
</span><a href="GHC.Driver.Types.html#InstalledFound"><span class="hs-identifier hs-var">InstalledFound</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ModLocation
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;GHC.Prim ModLocation&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949705"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-368"></span><span>        </span><span class="hs-keyword">else</span><span>
</span><span id="line-369"></span><span>
</span><span id="line-370"></span><span>  </span><span class="hs-keyword">let</span><span>
</span><span id="line-371"></span><span>     </span><span id="local-6989586621680949698"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621680949698"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621680949706"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-372"></span><span>     </span><span id="local-6989586621680949697"><span class="annot"><span class="annottext">tag :: String
</span><a href="#local-6989586621680949697"><span class="hs-identifier hs-var hs-var">tag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set Way -&gt; String
</span><a href="GHC.Driver.Ways.html#waysBuildTag"><span class="hs-identifier hs-var">waysBuildTag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Set Way
</span><a href="GHC.Driver.Session.html#ways"><span class="hs-identifier hs-var hs-var">ways</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949698"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span>           </span><span class="hs-comment">-- hi-suffix for packages depends on the build tag.</span><span>
</span><span id="line-375"></span><span>     </span><span id="local-6989586621680949693"><span class="annot"><span class="annottext">package_hisuf :: String
</span><a href="#local-6989586621680949693"><span class="hs-identifier hs-var hs-var">package_hisuf</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949697"><span class="hs-identifier hs-var">tag</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;hi&quot;</span></span><span>
</span><span id="line-376"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949697"><span class="hs-identifier hs-var">tag</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_hi&quot;</span></span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span>     </span><span id="local-6989586621680949691"><span class="annot"><span class="annottext">mk_hi_loc :: String -&gt; String -&gt; IO ModLocation
</span><a href="#local-6989586621680949691"><span class="hs-identifier hs-var hs-var">mk_hi_loc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHiOnlyModLocation"><span class="hs-identifier hs-var">mkHiOnlyModLocation</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949698"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949693"><span class="hs-identifier hs-var">package_hisuf</span></a></span><span>
</span><span id="line-379"></span><span>
</span><span id="line-380"></span><span>     </span><span id="local-6989586621680949690"><span class="annot"><span class="annottext">import_dirs :: [String]
</span><a href="#local-6989586621680949690"><span class="hs-identifier hs-var hs-var">import_dirs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitInfo -&gt; [String]
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; [String]
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitImportDirs"><span class="hs-identifier hs-var hs-var">unitImportDirs</span></a></span><span> </span><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949704"><span class="hs-identifier hs-var">pkg_conf</span></a></span><span>
</span><span id="line-381"></span><span>      </span><span class="hs-comment">-- we never look for a .hi-boot file in an external package;</span><span>
</span><span id="line-382"></span><span>      </span><span class="hs-comment">-- .hi-boot files only make sense for the home package.</span><span>
</span><span id="line-383"></span><span>  </span><span class="hs-keyword">in</span><span>
</span><span id="line-384"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949690"><span class="hs-identifier hs-var">import_dirs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-385"></span><span>    </span><span class="hs-special">[</span><span id="local-6989586621680949688"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949688"><span class="hs-identifier hs-var">one</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GhcMode
</span><a href="GHC.Driver.Session.html#MkDepend"><span class="hs-identifier hs-var">MkDepend</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; GhcMode
</span><a href="GHC.Driver.Session.html#ghcMode"><span class="hs-identifier hs-var hs-var">ghcMode</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949698"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-386"></span><span>          </span><span class="hs-comment">-- there's only one place that this .hi file can be, so</span><span>
</span><span id="line-387"></span><span>          </span><span class="hs-comment">-- don't bother looking for it.</span><span>
</span><span id="line-388"></span><span>          </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949686"><span class="annot"><span class="annottext">basename :: String
</span><a href="#local-6989586621680949686"><span class="hs-identifier hs-var hs-var">basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; String
</span><a href="GHC.Unit.Module.Name.html#moduleNameSlashes"><span class="hs-identifier hs-var">moduleNameSlashes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledModule -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949705"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span>          </span><span id="local-6989586621680949684"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949684"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ModLocation
</span><a href="#local-6989586621680949691"><span class="hs-identifier hs-var">mk_hi_loc</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949688"><span class="hs-identifier hs-var">one</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949686"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-390"></span><span>          </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; InstalledModule -&gt; InstalledFindResult
</span><a href="GHC.Driver.Types.html#InstalledFound"><span class="hs-identifier hs-var">InstalledFound</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949684"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949705"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-391"></span><span>    </span><span id="local-6989586621680949683"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949683"><span class="hs-identifier hs-var">_otherwise</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-392"></span><span>          </span><span class="annot"><span class="annottext">[String]
-&gt; InstalledModule
-&gt; [(String, String -&gt; String -&gt; IO ModLocation)]
-&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#searchPathExts"><span class="hs-identifier hs-var">searchPathExts</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949690"><span class="hs-identifier hs-var">import_dirs</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949705"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949693"><span class="hs-identifier hs-var">package_hisuf</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ModLocation
</span><a href="#local-6989586621680949691"><span class="hs-identifier hs-var">mk_hi_loc</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-393"></span><span>
</span><span id="line-394"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-395"></span><span class="hs-comment">-- General path searching</span><span>
</span><span id="line-396"></span><span>
</span><span id="line-397"></span><span class="annot"><a href="GHC.Driver.Finder.html#searchPathExts"><span class="hs-identifier hs-type">searchPathExts</span></a></span><span>
</span><span id="line-398"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span>         </span><span class="hs-comment">-- paths to search</span><span>
</span><span id="line-399"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#InstalledModule"><span class="hs-identifier hs-type">InstalledModule</span></a></span><span>             </span><span class="hs-comment">-- module name</span><span>
</span><span id="line-400"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-401"></span><span>        </span><span class="annot"><a href="GHC.Driver.Finder.html#FileExt"><span class="hs-identifier hs-type">FileExt</span></a></span><span class="hs-special">,</span><span>                                </span><span class="hs-comment">-- suffix</span><span>
</span><span id="line-402"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html#BaseName"><span class="hs-identifier hs-type">BaseName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span>  </span><span class="hs-comment">-- action</span><span>
</span><span id="line-403"></span><span>       </span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span>     </span><span class="hs-special">]</span><span>
</span><span id="line-405"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span id="searchPathExts"><span class="annot"><span class="annottext">searchPathExts :: [String]
-&gt; InstalledModule
-&gt; [(String, String -&gt; String -&gt; IO ModLocation)]
-&gt; IO InstalledFindResult
</span><a href="GHC.Driver.Finder.html#searchPathExts"><span class="hs-identifier hs-var hs-var">searchPathExts</span></a></span></span><span> </span><span id="local-6989586621680949681"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949681"><span class="hs-identifier hs-var">paths</span></a></span></span><span> </span><span id="local-6989586621680949680"><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949680"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949679"><span class="annot"><span class="annottext">[(String, String -&gt; String -&gt; IO ModLocation)]
</span><a href="#local-6989586621680949679"><span class="hs-identifier hs-var">exts</span></a></span></span><span>
</span><span id="line-408"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621680949678"><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949678"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(String, IO ModLocation)] -&gt; IO InstalledFindResult
</span><a href="#local-6989586621680949677"><span class="hs-identifier hs-var">search</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, IO ModLocation)]
</span><a href="#local-6989586621680949676"><span class="hs-identifier hs-var">to_search</span></a></span><span>
</span><span id="line-409"></span><span class="hs-comment">{-
        hPutStrLn stderr (showSDoc $
                vcat [text &quot;Search&quot; &lt;+&gt; ppr mod &lt;+&gt; sep (map (text. fst) exts)
                    , nest 2 (vcat (map text paths))
                    , case result of
                        Succeeded (loc, p) -&gt; text &quot;Found&quot; &lt;+&gt; ppr loc
                        Failed fs          -&gt; text &quot;not found&quot;])
-}</span><span>
</span><span id="line-417"></span><span>        </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949678"><span class="hs-identifier hs-var">result</span></a></span><span>
</span><span id="line-418"></span><span>
</span><span id="line-419"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-420"></span><span>    </span><span id="local-6989586621680949675"><span class="annot"><span class="annottext">basename :: String
</span><a href="#local-6989586621680949675"><span class="hs-identifier hs-var hs-var">basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; String
</span><a href="GHC.Unit.Module.Name.html#moduleNameSlashes"><span class="hs-identifier hs-var">moduleNameSlashes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledModule -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949680"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-421"></span><span>
</span><span id="line-422"></span><span>    </span><span class="annot"><a href="#local-6989586621680949676"><span class="hs-identifier hs-type">to_search</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-423"></span><span>    </span><span id="local-6989586621680949676"><span class="annot"><span class="annottext">to_search :: [(String, IO ModLocation)]
</span><a href="#local-6989586621680949676"><span class="hs-identifier hs-var hs-var">to_search</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949674"><span class="hs-identifier hs-var">file</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ModLocation
</span><a href="#local-6989586621680949673"><span class="hs-identifier hs-var">fn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949672"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949675"><span class="hs-identifier hs-var">basename</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-424"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621680949672"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949672"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949681"><span class="hs-identifier hs-var">paths</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-425"></span><span>                  </span><span class="hs-special">(</span><span id="local-6989586621680949671"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949671"><span class="hs-identifier hs-var">ext</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680949673"><span class="annot"><span class="annottext">String -&gt; String -&gt; IO ModLocation
</span><a href="#local-6989586621680949673"><span class="hs-identifier hs-var">fn</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(String, String -&gt; String -&gt; IO ModLocation)]
</span><a href="#local-6989586621680949679"><span class="hs-identifier hs-var">exts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-426"></span><span>                  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949666"><span class="annot"><span class="annottext">base :: String
</span><a href="#local-6989586621680949666"><span class="hs-identifier hs-var hs-var">base</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949672"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;.&quot;</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949675"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-427"></span><span>                           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949672"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949675"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-428"></span><span>                      </span><span id="local-6989586621680949674"><span class="annot"><span class="annottext">file :: String
</span><a href="#local-6989586621680949674"><span class="hs-identifier hs-var hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949666"><span class="hs-identifier hs-var">base</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949671"><span class="hs-identifier hs-var">ext</span></a></span><span>
</span><span id="line-429"></span><span>                </span><span class="hs-special">]</span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span>    </span><span id="local-6989586621680949677"><span class="annot"><span class="annottext">search :: [(String, IO ModLocation)] -&gt; IO InstalledFindResult
</span><a href="#local-6989586621680949677"><span class="hs-identifier hs-var hs-var">search</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; Maybe UnitId -&gt; InstalledFindResult
</span><a href="GHC.Driver.Types.html#InstalledNotFound"><span class="hs-identifier hs-var">InstalledNotFound</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((String, IO ModLocation) -&gt; String)
-&gt; [(String, IO ModLocation)] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(String, IO ModLocation) -&gt; String
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, IO ModLocation)]
</span><a href="#local-6989586621680949676"><span class="hs-identifier hs-var">to_search</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; Maybe UnitId
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstalledModule -&gt; UnitId
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949680"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>
</span><span id="line-433"></span><span>    </span><span class="annot"><a href="#local-6989586621680949677"><span class="hs-identifier hs-var">search</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621680949659"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949659"><span class="hs-identifier hs-var">file</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680949658"><span class="annot"><span class="annottext">IO ModLocation
</span><a href="#local-6989586621680949658"><span class="hs-identifier hs-var">mk_result</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680949657"><span class="annot"><span class="annottext">[(String, IO ModLocation)]
</span><a href="#local-6989586621680949657"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-434"></span><span>      </span><span id="local-6989586621680949656"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680949656"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO Bool
</span><a href="../../directory/src/System.Directory.html#doesFileExist"><span class="hs-identifier hs-var">doesFileExist</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949659"><span class="hs-identifier hs-var">file</span></a></span><span>
</span><span id="line-435"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680949656"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-436"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680949654"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949654"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO ModLocation
</span><a href="#local-6989586621680949658"><span class="hs-identifier hs-var">mk_result</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult -&gt; IO InstalledFindResult
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; InstalledModule -&gt; InstalledFindResult
</span><a href="GHC.Driver.Types.html#InstalledFound"><span class="hs-identifier hs-var">InstalledFound</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949654"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">InstalledModule
</span><a href="#local-6989586621680949680"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-437"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">[(String, IO ModLocation)] -&gt; IO InstalledFindResult
</span><a href="#local-6989586621680949677"><span class="hs-identifier hs-var">search</span></a></span><span> </span><span class="annot"><span class="annottext">[(String, IO ModLocation)]
</span><a href="#local-6989586621680949657"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkHomeModLocationSearched"><span class="hs-identifier hs-type">mkHomeModLocationSearched</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html#FileExt"><span class="hs-identifier hs-type">FileExt</span></a></span><span>
</span><span id="line-440"></span><span>                          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html#BaseName"><span class="hs-identifier hs-type">BaseName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span>
</span><span id="line-441"></span><span id="mkHomeModLocationSearched"><span class="annot"><span class="annottext">mkHomeModLocationSearched :: DynFlags
-&gt; ModuleName -&gt; String -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocationSearched"><span class="hs-identifier hs-var hs-var">mkHomeModLocationSearched</span></a></span></span><span> </span><span id="local-6989586621680949653"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949653"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949652"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949652"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949651"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949651"><span class="hs-identifier hs-var">suff</span></a></span></span><span> </span><span id="local-6989586621680949650"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949650"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621680949649"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949649"><span class="hs-identifier hs-var">basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-442"></span><span>   </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocation2"><span class="hs-identifier hs-var">mkHomeModLocation2</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949653"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949652"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949650"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949649"><span class="hs-identifier hs-var">basename</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949651"><span class="hs-identifier hs-var">suff</span></a></span><span>
</span><span id="line-443"></span><span>
</span><span id="line-444"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-445"></span><span class="hs-comment">-- Constructing a home module location</span><span>
</span><span id="line-446"></span><span>
</span><span id="line-447"></span><span class="hs-comment">-- This is where we construct the ModLocation for a module in the home</span><span>
</span><span id="line-448"></span><span class="hs-comment">-- package, for which we have a source file.  It is called from three</span><span>
</span><span id="line-449"></span><span class="hs-comment">-- places:</span><span>
</span><span id="line-450"></span><span class="hs-comment">--</span><span>
</span><span id="line-451"></span><span class="hs-comment">--  (a) Here in the finder, when we are searching for a module to import,</span><span>
</span><span id="line-452"></span><span class="hs-comment">--      using the search path (-i option).</span><span>
</span><span id="line-453"></span><span class="hs-comment">--</span><span>
</span><span id="line-454"></span><span class="hs-comment">--  (b) The compilation manager, when constructing the ModLocation for</span><span>
</span><span id="line-455"></span><span class="hs-comment">--      a &quot;root&quot; module (a source file named explicitly on the command line</span><span>
</span><span id="line-456"></span><span class="hs-comment">--      or in a :load command in GHCi).</span><span>
</span><span id="line-457"></span><span class="hs-comment">--</span><span>
</span><span id="line-458"></span><span class="hs-comment">--  (c) The driver in one-shot mode, when we need to construct a</span><span>
</span><span id="line-459"></span><span class="hs-comment">--      ModLocation for a source file named on the command-line.</span><span>
</span><span id="line-460"></span><span class="hs-comment">--</span><span>
</span><span id="line-461"></span><span class="hs-comment">-- Parameters are:</span><span>
</span><span id="line-462"></span><span class="hs-comment">--</span><span>
</span><span id="line-463"></span><span class="hs-comment">-- mod</span><span>
</span><span id="line-464"></span><span class="hs-comment">--      The name of the module</span><span>
</span><span id="line-465"></span><span class="hs-comment">--</span><span>
</span><span id="line-466"></span><span class="hs-comment">-- path</span><span>
</span><span id="line-467"></span><span class="hs-comment">--      (a): The search path component where the source file was found.</span><span>
</span><span id="line-468"></span><span class="hs-comment">--      (b) and (c): &quot;.&quot;</span><span>
</span><span id="line-469"></span><span class="hs-comment">--</span><span>
</span><span id="line-470"></span><span class="hs-comment">-- src_basename</span><span>
</span><span id="line-471"></span><span class="hs-comment">--      (a): (moduleNameSlashes mod)</span><span>
</span><span id="line-472"></span><span class="hs-comment">--      (b) and (c): The filename of the source file, minus its extension</span><span>
</span><span id="line-473"></span><span class="hs-comment">--</span><span>
</span><span id="line-474"></span><span class="hs-comment">-- ext</span><span>
</span><span id="line-475"></span><span class="hs-comment">--      The filename extension of the source file (usually &quot;hs&quot; or &quot;lhs&quot;).</span><span>
</span><span id="line-476"></span><span>
</span><span id="line-477"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkHomeModLocation"><span class="hs-identifier hs-type">mkHomeModLocation</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span>
</span><span id="line-478"></span><span id="mkHomeModLocation"><span class="annot"><span class="annottext">mkHomeModLocation :: DynFlags -&gt; ModuleName -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocation"><span class="hs-identifier hs-var hs-var">mkHomeModLocation</span></a></span></span><span> </span><span id="local-6989586621680949648"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949648"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949647"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949647"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949646"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949646"><span class="hs-identifier hs-var">src_filename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-479"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680949645"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949645"><span class="hs-identifier hs-var">basename</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621680949644"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949644"><span class="hs-identifier hs-var">extension</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, String)
</span><a href="../../filepath/src/System.FilePath.Windows.html#splitExtension"><span class="hs-identifier hs-var">splitExtension</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949646"><span class="hs-identifier hs-var">src_filename</span></a></span><span>
</span><span id="line-480"></span><span>   </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocation2"><span class="hs-identifier hs-var">mkHomeModLocation2</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949648"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949647"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949645"><span class="hs-identifier hs-var">basename</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949644"><span class="hs-identifier hs-var">extension</span></a></span><span>
</span><span id="line-481"></span><span>
</span><span id="line-482"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkHomeModLocation2"><span class="hs-identifier hs-type">mkHomeModLocation2</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-483"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>
</span><span id="line-484"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>  </span><span class="hs-comment">-- Of source module, without suffix</span><span>
</span><span id="line-485"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>    </span><span class="hs-comment">-- Suffix</span><span>
</span><span id="line-486"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span>
</span><span id="line-487"></span><span id="mkHomeModLocation2"><span class="annot"><span class="annottext">mkHomeModLocation2 :: DynFlags -&gt; ModuleName -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocation2"><span class="hs-identifier hs-var hs-var">mkHomeModLocation2</span></a></span></span><span> </span><span id="local-6989586621680949642"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949642"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949641"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949641"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949640"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949640"><span class="hs-identifier hs-var">src_basename</span></a></span></span><span> </span><span id="local-6989586621680949639"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949639"><span class="hs-identifier hs-var">ext</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-488"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949638"><span class="annot"><span class="annottext">mod_basename :: String
</span><a href="#local-6989586621680949638"><span class="hs-identifier hs-var hs-var">mod_basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; String
</span><a href="GHC.Unit.Module.Name.html#moduleNameSlashes"><span class="hs-identifier hs-var">moduleNameSlashes</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949641"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-489"></span><span>
</span><span id="line-490"></span><span>       </span><span id="local-6989586621680949637"><span class="annot"><span class="annottext">obj_fn :: String
</span><a href="#local-6989586621680949637"><span class="hs-identifier hs-var hs-var">obj_fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String -&gt; String -&gt; String
</span><a href="GHC.Driver.Finder.html#mkObjPath"><span class="hs-identifier hs-var">mkObjPath</span></a></span><span>  </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949642"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949640"><span class="hs-identifier hs-var">src_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949638"><span class="hs-identifier hs-var">mod_basename</span></a></span><span>
</span><span id="line-491"></span><span>       </span><span id="local-6989586621680949636"><span class="annot"><span class="annottext">hi_fn :: String
</span><a href="#local-6989586621680949636"><span class="hs-identifier hs-var hs-var">hi_fn</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String -&gt; String -&gt; String
</span><a href="GHC.Driver.Finder.html#mkHiPath"><span class="hs-identifier hs-var">mkHiPath</span></a></span><span>   </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949642"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949640"><span class="hs-identifier hs-var">src_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949638"><span class="hs-identifier hs-var">mod_basename</span></a></span><span>
</span><span id="line-492"></span><span>       </span><span id="local-6989586621680949635"><span class="annot"><span class="annottext">hie_fn :: String
</span><a href="#local-6989586621680949635"><span class="hs-identifier hs-var hs-var">hie_fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String -&gt; String -&gt; String
</span><a href="GHC.Driver.Finder.html#mkHiePath"><span class="hs-identifier hs-var">mkHiePath</span></a></span><span>  </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949642"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949640"><span class="hs-identifier hs-var">src_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949638"><span class="hs-identifier hs-var">mod_basename</span></a></span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span>   </span><span class="annot"><span class="annottext">ModLocation -&gt; IO ModLocation
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation :: Maybe String -&gt; String -&gt; String -&gt; String -&gt; ModLocation
</span><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ml_hs_file :: Maybe String
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var">ml_hs_file</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949640"><span class="hs-identifier hs-var">src_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949639"><span class="hs-identifier hs-var">ext</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-495"></span><span>                        </span><span class="annot"><span class="annottext">ml_hi_file :: String
</span><a href="GHC.Unit.Module.Location.html#ml_hi_file"><span class="hs-identifier hs-var">ml_hi_file</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949636"><span class="hs-identifier hs-var">hi_fn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-496"></span><span>                        </span><span class="annot"><span class="annottext">ml_obj_file :: String
</span><a href="GHC.Unit.Module.Location.html#ml_obj_file"><span class="hs-identifier hs-var">ml_obj_file</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949637"><span class="hs-identifier hs-var">obj_fn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-497"></span><span>                        </span><span class="annot"><span class="annottext">ml_hie_file :: String
</span><a href="GHC.Unit.Module.Location.html#ml_hie_file"><span class="hs-identifier hs-var">ml_hie_file</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949635"><span class="hs-identifier hs-var">hie_fn</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-498"></span><span>
</span><span id="line-499"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkHomeModHiOnlyLocation"><span class="hs-identifier hs-type">mkHomeModHiOnlyLocation</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-500"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>
</span><span id="line-501"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-502"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Finder.html#BaseName"><span class="hs-identifier hs-type">BaseName</span></a></span><span>
</span><span id="line-503"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span>
</span><span id="line-504"></span><span id="mkHomeModHiOnlyLocation"><span class="annot"><span class="annottext">mkHomeModHiOnlyLocation :: DynFlags -&gt; ModuleName -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModHiOnlyLocation"><span class="hs-identifier hs-var hs-var">mkHomeModHiOnlyLocation</span></a></span></span><span> </span><span id="local-6989586621680949628"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949628"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949627"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949627"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949626"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949626"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621680949625"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949625"><span class="hs-identifier hs-var">basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-505"></span><span>   </span><span id="local-6989586621680949624"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949624"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ModuleName -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHomeModLocation2"><span class="hs-identifier hs-var">mkHomeModLocation2</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949628"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949627"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949626"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949625"><span class="hs-identifier hs-var">basename</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-506"></span><span>   </span><span class="annot"><span class="annottext">ModLocation -&gt; IO ModLocation
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949624"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ml_hs_file :: Maybe String
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var">ml_hs_file</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-507"></span><span>
</span><span id="line-508"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkHiOnlyModLocation"><span class="hs-identifier hs-type">mkHiOnlyModLocation</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html#Suffix"><span class="hs-identifier hs-type">Suffix</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-509"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span>
</span><span id="line-510"></span><span id="mkHiOnlyModLocation"><span class="annot"><span class="annottext">mkHiOnlyModLocation :: DynFlags -&gt; String -&gt; String -&gt; String -&gt; IO ModLocation
</span><a href="GHC.Driver.Finder.html#mkHiOnlyModLocation"><span class="hs-identifier hs-var hs-var">mkHiOnlyModLocation</span></a></span></span><span> </span><span id="local-6989586621680949622"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949622"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949621"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949621"><span class="hs-identifier hs-var">hisuf</span></a></span></span><span> </span><span id="local-6989586621680949620"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949620"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span id="local-6989586621680949619"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949619"><span class="hs-identifier hs-var">basename</span></a></span></span><span>
</span><span id="line-511"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949618"><span class="annot"><span class="annottext">full_basename :: String
</span><a href="#local-6989586621680949618"><span class="hs-identifier hs-var hs-var">full_basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949620"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949619"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-512"></span><span>          </span><span id="local-6989586621680949617"><span class="annot"><span class="annottext">obj_fn :: String
</span><a href="#local-6989586621680949617"><span class="hs-identifier hs-var hs-var">obj_fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String -&gt; String -&gt; String
</span><a href="GHC.Driver.Finder.html#mkObjPath"><span class="hs-identifier hs-var">mkObjPath</span></a></span><span>  </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949622"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949618"><span class="hs-identifier hs-var">full_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949619"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-513"></span><span>          </span><span id="local-6989586621680949616"><span class="annot"><span class="annottext">hie_fn :: String
</span><a href="#local-6989586621680949616"><span class="hs-identifier hs-var hs-var">hie_fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String -&gt; String -&gt; String
</span><a href="GHC.Driver.Finder.html#mkHiePath"><span class="hs-identifier hs-var">mkHiePath</span></a></span><span>  </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949622"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949618"><span class="hs-identifier hs-var">full_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949619"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-514"></span><span>      </span><span class="annot"><span class="annottext">ModLocation -&gt; IO ModLocation
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation :: Maybe String -&gt; String -&gt; String -&gt; String -&gt; ModLocation
</span><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span class="hs-special">{</span><span>    </span><span class="annot"><span class="annottext">ml_hs_file :: Maybe String
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var">ml_hs_file</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe String
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-515"></span><span>                             </span><span class="annot"><span class="annottext">ml_hi_file :: String
</span><a href="GHC.Unit.Module.Location.html#ml_hi_file"><span class="hs-identifier hs-var">ml_hi_file</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949618"><span class="hs-identifier hs-var">full_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949621"><span class="hs-identifier hs-var">hisuf</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-516"></span><span>                                </span><span class="hs-comment">-- Remove the .hi-boot suffix from</span><span>
</span><span id="line-517"></span><span>                                </span><span class="hs-comment">-- hi_file, if it had one.  We always</span><span>
</span><span id="line-518"></span><span>                                </span><span class="hs-comment">-- want the name of the real .hi file</span><span>
</span><span id="line-519"></span><span>                                </span><span class="hs-comment">-- in the ml_hi_file field.</span><span>
</span><span id="line-520"></span><span>                             </span><span class="annot"><span class="annottext">ml_obj_file :: String
</span><a href="GHC.Unit.Module.Location.html#ml_obj_file"><span class="hs-identifier hs-var">ml_obj_file</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949617"><span class="hs-identifier hs-var">obj_fn</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-521"></span><span>                             </span><span class="annot"><span class="annottext">ml_hie_file :: String
</span><a href="GHC.Unit.Module.Location.html#ml_hie_file"><span class="hs-identifier hs-var">ml_hie_file</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949616"><span class="hs-identifier hs-var">hie_fn</span></a></span><span>
</span><span id="line-522"></span><span>                  </span><span class="hs-special">}</span><span>
</span><span id="line-523"></span><span>
</span><span id="line-524"></span><span class="hs-comment">-- | Constructs the filename of a .o file for a given source file.</span><span>
</span><span id="line-525"></span><span class="hs-comment">-- Does /not/ check whether the .o file exists</span><span>
</span><span id="line-526"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkObjPath"><span class="hs-identifier hs-type">mkObjPath</span></a></span><span>
</span><span id="line-527"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-528"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>           </span><span class="hs-comment">-- the filename of the source file, minus the extension</span><span>
</span><span id="line-529"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>             </span><span class="hs-comment">-- the module name with dots replaced by slashes</span><span>
</span><span id="line-530"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-531"></span><span id="mkObjPath"><span class="annot"><span class="annottext">mkObjPath :: DynFlags -&gt; String -&gt; String -&gt; String
</span><a href="GHC.Driver.Finder.html#mkObjPath"><span class="hs-identifier hs-var hs-var">mkObjPath</span></a></span></span><span> </span><span id="local-6989586621680949615"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949615"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949614"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949614"><span class="hs-identifier hs-var">basename</span></a></span></span><span> </span><span id="local-6989586621680949613"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949613"><span class="hs-identifier hs-var">mod_basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949612"><span class="hs-identifier hs-var">obj_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949611"><span class="hs-identifier hs-var">osuf</span></a></span><span>
</span><span id="line-532"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-533"></span><span>                </span><span id="local-6989586621680949610"><span class="annot"><span class="annottext">odir :: Maybe String
</span><a href="#local-6989586621680949610"><span class="hs-identifier hs-var hs-var">odir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe String
</span><a href="GHC.Driver.Session.html#objectDir"><span class="hs-identifier hs-var hs-var">objectDir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949615"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-534"></span><span>                </span><span id="local-6989586621680949611"><span class="annot"><span class="annottext">osuf :: String
</span><a href="#local-6989586621680949611"><span class="hs-identifier hs-var hs-var">osuf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String
</span><a href="GHC.Driver.Session.html#objectSuf"><span class="hs-identifier hs-var hs-var">objectSuf</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949615"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-535"></span><span>
</span><span id="line-536"></span><span>                </span><span id="local-6989586621680949612"><span class="annot"><span class="annottext">obj_basename :: String
</span><a href="#local-6989586621680949612"><span class="hs-identifier hs-var hs-var">obj_basename</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949607"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949607"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621680949610"><span class="hs-identifier hs-var">odir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949607"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949613"><span class="hs-identifier hs-var">mod_basename</span></a></span><span>
</span><span id="line-537"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949614"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-538"></span><span>
</span><span id="line-539"></span><span>
</span><span id="line-540"></span><span class="hs-comment">-- | Constructs the filename of a .hi file for a given source file.</span><span>
</span><span id="line-541"></span><span class="hs-comment">-- Does /not/ check whether the .hi file exists</span><span>
</span><span id="line-542"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkHiPath"><span class="hs-identifier hs-type">mkHiPath</span></a></span><span>
</span><span id="line-543"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-544"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>           </span><span class="hs-comment">-- the filename of the source file, minus the extension</span><span>
</span><span id="line-545"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>             </span><span class="hs-comment">-- the module name with dots replaced by slashes</span><span>
</span><span id="line-546"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-547"></span><span id="mkHiPath"><span class="annot"><span class="annottext">mkHiPath :: DynFlags -&gt; String -&gt; String -&gt; String
</span><a href="GHC.Driver.Finder.html#mkHiPath"><span class="hs-identifier hs-var hs-var">mkHiPath</span></a></span></span><span> </span><span id="local-6989586621680949606"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949606"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949605"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949605"><span class="hs-identifier hs-var">basename</span></a></span></span><span> </span><span id="local-6989586621680949604"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949604"><span class="hs-identifier hs-var">mod_basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949603"><span class="hs-identifier hs-var">hi_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949602"><span class="hs-identifier hs-var">hisuf</span></a></span><span>
</span><span id="line-548"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-549"></span><span>                </span><span id="local-6989586621680949601"><span class="annot"><span class="annottext">hidir :: Maybe String
</span><a href="#local-6989586621680949601"><span class="hs-identifier hs-var hs-var">hidir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe String
</span><a href="GHC.Driver.Session.html#hiDir"><span class="hs-identifier hs-var hs-var">hiDir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949606"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-550"></span><span>                </span><span id="local-6989586621680949602"><span class="annot"><span class="annottext">hisuf :: String
</span><a href="#local-6989586621680949602"><span class="hs-identifier hs-var hs-var">hisuf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String
</span><a href="GHC.Driver.Session.html#hiSuf"><span class="hs-identifier hs-var hs-var">hiSuf</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949606"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-551"></span><span>
</span><span id="line-552"></span><span>                </span><span id="local-6989586621680949603"><span class="annot"><span class="annottext">hi_basename :: String
</span><a href="#local-6989586621680949603"><span class="hs-identifier hs-var hs-var">hi_basename</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949599"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949599"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621680949601"><span class="hs-identifier hs-var">hidir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949599"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949604"><span class="hs-identifier hs-var">mod_basename</span></a></span><span>
</span><span id="line-553"></span><span>                            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949605"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-554"></span><span>
</span><span id="line-555"></span><span class="hs-comment">-- | Constructs the filename of a .hie file for a given source file.</span><span>
</span><span id="line-556"></span><span class="hs-comment">-- Does /not/ check whether the .hie file exists</span><span>
</span><span id="line-557"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkHiePath"><span class="hs-identifier hs-type">mkHiePath</span></a></span><span>
</span><span id="line-558"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-559"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>           </span><span class="hs-comment">-- the filename of the source file, minus the extension</span><span>
</span><span id="line-560"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>             </span><span class="hs-comment">-- the module name with dots replaced by slashes</span><span>
</span><span id="line-561"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-562"></span><span id="mkHiePath"><span class="annot"><span class="annottext">mkHiePath :: DynFlags -&gt; String -&gt; String -&gt; String
</span><a href="GHC.Driver.Finder.html#mkHiePath"><span class="hs-identifier hs-var hs-var">mkHiePath</span></a></span></span><span> </span><span id="local-6989586621680949598"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949598"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949597"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949597"><span class="hs-identifier hs-var">basename</span></a></span></span><span> </span><span id="local-6989586621680949596"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949596"><span class="hs-identifier hs-var">mod_basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949595"><span class="hs-identifier hs-var">hie_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949594"><span class="hs-identifier hs-var">hiesuf</span></a></span><span>
</span><span id="line-563"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-564"></span><span>                </span><span id="local-6989586621680949593"><span class="annot"><span class="annottext">hiedir :: Maybe String
</span><a href="#local-6989586621680949593"><span class="hs-identifier hs-var hs-var">hiedir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe String
</span><a href="GHC.Driver.Session.html#hieDir"><span class="hs-identifier hs-var hs-var">hieDir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949598"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-565"></span><span>                </span><span id="local-6989586621680949594"><span class="annot"><span class="annottext">hiesuf :: String
</span><a href="#local-6989586621680949594"><span class="hs-identifier hs-var hs-var">hiesuf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; String
</span><a href="GHC.Driver.Session.html#hieSuf"><span class="hs-identifier hs-var hs-var">hieSuf</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949598"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-566"></span><span>
</span><span id="line-567"></span><span>                </span><span id="local-6989586621680949595"><span class="annot"><span class="annottext">hie_basename :: String
</span><a href="#local-6989586621680949595"><span class="hs-identifier hs-var hs-var">hie_basename</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949590"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949590"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621680949593"><span class="hs-identifier hs-var">hiedir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949590"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949596"><span class="hs-identifier hs-var">mod_basename</span></a></span><span>
</span><span id="line-568"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949597"><span class="hs-identifier hs-var">basename</span></a></span><span>
</span><span id="line-569"></span><span>
</span><span id="line-570"></span><span>
</span><span id="line-571"></span><span>
</span><span id="line-572"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-573"></span><span class="hs-comment">-- Filenames of the stub files</span><span>
</span><span id="line-574"></span><span>
</span><span id="line-575"></span><span class="hs-comment">-- We don't have to store these in ModLocations, because they can be derived</span><span>
</span><span id="line-576"></span><span class="hs-comment">-- from other available information, and they're only rarely needed.</span><span>
</span><span id="line-577"></span><span>
</span><span id="line-578"></span><span class="annot"><a href="GHC.Driver.Finder.html#mkStubPaths"><span class="hs-identifier hs-type">mkStubPaths</span></a></span><span>
</span><span id="line-579"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-580"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>
</span><span id="line-581"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span>
</span><span id="line-582"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-583"></span><span>
</span><span id="line-584"></span><span id="mkStubPaths"><span class="annot"><span class="annottext">mkStubPaths :: DynFlags -&gt; ModuleName -&gt; ModLocation -&gt; String
</span><a href="GHC.Driver.Finder.html#mkStubPaths"><span class="hs-identifier hs-var hs-var">mkStubPaths</span></a></span></span><span> </span><span id="local-6989586621680949589"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949589"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949588"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949588"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949587"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949587"><span class="hs-identifier hs-var">location</span></a></span></span><span>
</span><span id="line-585"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-586"></span><span>        </span><span id="local-6989586621680949586"><span class="annot"><span class="annottext">stubdir :: Maybe String
</span><a href="#local-6989586621680949586"><span class="hs-identifier hs-var hs-var">stubdir</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe String
</span><a href="GHC.Driver.Session.html#stubDir"><span class="hs-identifier hs-var hs-var">stubDir</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949589"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-587"></span><span>
</span><span id="line-588"></span><span>        </span><span id="local-6989586621680949584"><span class="annot"><span class="annottext">mod_basename :: String
</span><a href="#local-6989586621680949584"><span class="hs-identifier hs-var hs-var">mod_basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; String
</span><a href="GHC.Unit.Module.Name.html#moduleNameSlashes"><span class="hs-identifier hs-var">moduleNameSlashes</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949588"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-589"></span><span>        </span><span id="local-6989586621680949581"><span class="annot"><span class="annottext">src_basename :: String
</span><a href="#local-6989586621680949581"><span class="hs-identifier hs-var hs-var">src_basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#dropExtension"><span class="hs-identifier hs-var">dropExtension</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String) -&gt; String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe String -&gt; String
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mkStubPaths&quot;</span></span><span>
</span><span id="line-590"></span><span>                                                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModLocation -&gt; Maybe String
</span><a href="GHC.Unit.Module.Location.html#ml_hs_file"><span class="hs-identifier hs-var hs-var">ml_hs_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949587"><span class="hs-identifier hs-var">location</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-591"></span><span>
</span><span id="line-592"></span><span>        </span><span id="local-6989586621680949579"><span class="annot"><span class="annottext">stub_basename0 :: String
</span><a href="#local-6989586621680949579"><span class="hs-identifier hs-var hs-var">stub_basename0</span></a></span></span><span>
</span><span id="line-593"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949578"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949578"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621680949586"><span class="hs-identifier hs-var">stubdir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949578"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C%2F%3E"><span class="hs-operator hs-var">&lt;/&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949584"><span class="hs-identifier hs-var">mod_basename</span></a></span><span>
</span><span id="line-594"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949581"><span class="hs-identifier hs-var">src_basename</span></a></span><span>
</span><span id="line-595"></span><span>
</span><span id="line-596"></span><span>        </span><span id="local-6989586621680949577"><span class="annot"><span class="annottext">stub_basename :: String
</span><a href="#local-6989586621680949577"><span class="hs-identifier hs-var hs-var">stub_basename</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949579"><span class="hs-identifier hs-var">stub_basename0</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_stub&quot;</span></span><span>
</span><span id="line-597"></span><span>     </span><span class="hs-keyword">in</span><span>
</span><span id="line-598"></span><span>        </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949577"><span class="hs-identifier hs-var">stub_basename</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="../../filepath/src/System.FilePath.Windows.html#%3C.%3E"><span class="hs-operator hs-var">&lt;.&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;h&quot;</span></span><span>
</span><span id="line-599"></span><span>
</span><span id="line-600"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-601"></span><span class="hs-comment">-- findLinkable isn't related to the other stuff in here,</span><span>
</span><span id="line-602"></span><span class="hs-comment">-- but there's no other obvious place for it</span><span>
</span><span id="line-603"></span><span>
</span><span id="line-604"></span><span class="annot"><a href="GHC.Driver.Finder.html#findObjectLinkableMaybe"><span class="hs-identifier hs-type">findObjectLinkableMaybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Location.html#ModLocation"><span class="hs-identifier hs-type">ModLocation</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Runtime.Linker.Types.html#Linkable"><span class="hs-identifier hs-type">Linkable</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-605"></span><span id="findObjectLinkableMaybe"><span class="annot"><span class="annottext">findObjectLinkableMaybe :: GenModule Unit -&gt; ModLocation -&gt; IO (Maybe Linkable)
</span><a href="GHC.Driver.Finder.html#findObjectLinkableMaybe"><span class="hs-identifier hs-var hs-var">findObjectLinkableMaybe</span></a></span></span><span> </span><span id="local-6989586621680949576"><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949576"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949575"><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949575"><span class="hs-identifier hs-var">locn</span></a></span></span><span>
</span><span id="line-606"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949574"><span class="annot"><span class="annottext">obj_fn :: String
</span><a href="#local-6989586621680949574"><span class="hs-identifier hs-var hs-var">obj_fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModLocation -&gt; String
</span><a href="GHC.Unit.Module.Location.html#ml_obj_file"><span class="hs-identifier hs-var hs-var">ml_obj_file</span></a></span><span> </span><span class="annot"><span class="annottext">ModLocation
</span><a href="#local-6989586621680949575"><span class="hs-identifier hs-var">locn</span></a></span><span>
</span><span id="line-607"></span><span>        </span><span id="local-6989586621680949573"><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621680949573"><span class="hs-identifier hs-var">maybe_obj_time</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO (Maybe UTCTime)
</span><a href="GHC.Utils.Misc.html#modificationTimeIfExists"><span class="hs-identifier hs-var">modificationTimeIfExists</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949574"><span class="hs-identifier hs-var">obj_fn</span></a></span><span>
</span><span id="line-608"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="#local-6989586621680949573"><span class="hs-identifier hs-var">maybe_obj_time</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-609"></span><span>          </span><span class="annot"><span class="annottext">Maybe UTCTime
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe Linkable -&gt; IO (Maybe Linkable)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Linkable
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-610"></span><span>          </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949571"><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621680949571"><span class="hs-identifier hs-var">obj_time</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Linkable -&gt; Maybe Linkable) -&gt; IO Linkable -&gt; IO (Maybe Linkable)
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">Linkable -&gt; Maybe Linkable
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; String -&gt; UTCTime -&gt; IO Linkable
</span><a href="GHC.Driver.Finder.html#findObjectLinkable"><span class="hs-identifier hs-var">findObjectLinkable</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949576"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949574"><span class="hs-identifier hs-var">obj_fn</span></a></span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621680949571"><span class="hs-identifier hs-var">obj_time</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-611"></span><span>
</span><span id="line-612"></span><span class="hs-comment">-- Make an object linkable when we know the object file exists, and we know</span><span>
</span><span id="line-613"></span><span class="hs-comment">-- its modification time.</span><span>
</span><span id="line-614"></span><span class="annot"><a href="GHC.Driver.Finder.html#findObjectLinkable"><span class="hs-identifier hs-type">findObjectLinkable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../time/src/Data.Time.Clock.Internal.UTCTime.html#UTCTime"><span class="hs-identifier hs-type">UTCTime</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Runtime.Linker.Types.html#Linkable"><span class="hs-identifier hs-type">Linkable</span></a></span><span>
</span><span id="line-615"></span><span id="findObjectLinkable"><span class="annot"><span class="annottext">findObjectLinkable :: GenModule Unit -&gt; String -&gt; UTCTime -&gt; IO Linkable
</span><a href="GHC.Driver.Finder.html#findObjectLinkable"><span class="hs-identifier hs-var hs-var">findObjectLinkable</span></a></span></span><span> </span><span id="local-6989586621680949569"><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949569"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949568"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949568"><span class="hs-identifier hs-var">obj_fn</span></a></span></span><span> </span><span id="local-6989586621680949567"><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621680949567"><span class="hs-identifier hs-var">obj_time</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Linkable -&gt; IO Linkable
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UTCTime -&gt; GenModule Unit -&gt; [Unlinked] -&gt; Linkable
</span><a href="GHC.Runtime.Linker.Types.html#LM"><span class="hs-identifier hs-var">LM</span></a></span><span> </span><span class="annot"><span class="annottext">UTCTime
</span><a href="#local-6989586621680949567"><span class="hs-identifier hs-var">obj_time</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949569"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; Unlinked
</span><a href="GHC.Runtime.Linker.Types.html#DotO"><span class="hs-identifier hs-var">DotO</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949568"><span class="hs-identifier hs-var">obj_fn</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-616"></span><span>  </span><span class="hs-comment">-- We used to look for _stub.o files here, but that was a bug (#706)</span><span>
</span><span id="line-617"></span><span>  </span><span class="hs-comment">-- Now GHC merges the stub.o into the main .o (#3687)</span><span>
</span><span id="line-618"></span><span>
</span><span id="line-619"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-620"></span><span class="hs-comment">-- Error messages</span><span>
</span><span id="line-621"></span><span>
</span><span id="line-622"></span><span class="annot"><a href="GHC.Driver.Finder.html#cannotFindModule"><span class="hs-identifier hs-type">cannotFindModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-623"></span><span id="cannotFindModule"><span class="annot"><span class="annottext">cannotFindModule :: DynFlags -&gt; ModuleName -&gt; FindResult -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#cannotFindModule"><span class="hs-identifier hs-var hs-var">cannotFindModule</span></a></span></span><span> </span><span id="local-6989586621680949564"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949564"><span class="hs-identifier hs-var">flags</span></a></span></span><span> </span><span id="local-6989586621680949563"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949563"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949562"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949562"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-624"></span><span>  </span><span class="annot"><span class="annottext">PtrString
-&gt; PtrString -&gt; DynFlags -&gt; ModuleName -&gt; FindResult -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#cantFindErr"><span class="hs-identifier hs-var">cantFindErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949559"><span class="hs-identifier hs-var">cannotFindMsg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-625"></span><span>              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ambiguous module name&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-626"></span><span>              </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949564"><span class="hs-identifier hs-var">flags</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949563"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949562"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-627"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-628"></span><span>    </span><span id="local-6989586621680949559"><span class="annot"><span class="annottext">cannotFindMsg :: String
</span><a href="#local-6989586621680949559"><span class="hs-identifier hs-var hs-var">cannotFindMsg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-629"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949562"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-630"></span><span>        </span><span class="annot"><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: FindResult -&gt; [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949555"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949555"><span class="hs-identifier hs-var">hidden_mods</span></a></span></span><span>
</span><span id="line-631"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: FindResult -&gt; [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949554"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949554"><span class="hs-identifier hs-var">hidden_pkgs</span></a></span></span><span>
</span><span id="line-632"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: FindResult -&gt; [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949553"><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949553"><span class="hs-identifier hs-var">unusables</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-633"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Unit] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949555"><span class="hs-identifier hs-var">hidden_mods</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Unit] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949554"><span class="hs-identifier hs-var">hidden_pkgs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949553"><span class="hs-identifier hs-var">unusables</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-634"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Could not load module&quot;</span></span><span>
</span><span id="line-635"></span><span>        </span><span class="annot"><span class="annottext">FindResult
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Could not find module&quot;</span></span><span>
</span><span id="line-636"></span><span>
</span><span id="line-637"></span><span class="annot"><a href="GHC.Driver.Finder.html#cannotFindInterface"><span class="hs-identifier hs-type">cannotFindInterface</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-638"></span><span id="cannotFindInterface"><span class="annot"><span class="annottext">cannotFindInterface :: DynFlags -&gt; ModuleName -&gt; InstalledFindResult -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#cannotFindInterface"><span class="hs-identifier hs-var hs-var">cannotFindInterface</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PtrString
-&gt; PtrString
-&gt; DynFlags
-&gt; ModuleName
-&gt; InstalledFindResult
-&gt; SDoc
</span><a href="GHC.Driver.Finder.html#cantFindInstalledErr"><span class="hs-identifier hs-var">cantFindInstalledErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Failed to load interface for&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-639"></span><span>                                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ambiguous interface for&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-640"></span><span>
</span><span id="line-641"></span><span class="annot"><a href="GHC.Driver.Finder.html#cantFindErr"><span class="hs-identifier hs-type">cantFindErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#FindResult"><span class="hs-identifier hs-type">FindResult</span></a></span><span>
</span><span id="line-642"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-643"></span><span id="cantFindErr"><span class="annot"><span class="annottext">cantFindErr :: PtrString
-&gt; PtrString -&gt; DynFlags -&gt; ModuleName -&gt; FindResult -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#cantFindErr"><span class="hs-identifier hs-var hs-var">cantFindErr</span></a></span></span><span> </span><span class="annot"><span class="annottext">PtrString
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680949551"><span class="annot"><span class="annottext">PtrString
</span><a href="#local-6989586621680949551"><span class="hs-identifier hs-var">multiple_found</span></a></span></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680949550"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949550"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#FoundMultiple"><span class="hs-identifier hs-type">FoundMultiple</span></a></span><span> </span><span id="local-6989586621680949549"><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949549"><span class="hs-identifier hs-var">mods</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-644"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949548"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949548"><span class="hs-identifier hs-var">pkgs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe [Unit]
</span><a href="#local-6989586621680949547"><span class="hs-identifier hs-var">unambiguousPackages</span></a></span><span>
</span><span id="line-645"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString
</span><a href="#local-6989586621680949551"><span class="hs-identifier hs-var">multiple_found</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949550"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-646"></span><span>       </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;it was found in multiple packages:&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-647"></span><span>                </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Unit -&gt; SDoc) -&gt; [Unit] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949548"><span class="hs-identifier hs-var">pkgs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-648"></span><span>    </span><span class="hs-special">)</span><span>
</span><span id="line-649"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-650"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString
</span><a href="#local-6989586621680949551"><span class="hs-identifier hs-var">multiple_found</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949550"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-651"></span><span>       </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((GenModule Unit, ModuleOrigin) -&gt; SDoc)
-&gt; [(GenModule Unit, ModuleOrigin)] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(GenModule Unit, ModuleOrigin) -&gt; SDoc
forall {a}.
(Outputable a, Outputable (GenModule a)) =&gt;
(GenModule a, ModuleOrigin) -&gt; SDoc
</span><a href="#local-6989586621680949537"><span class="hs-identifier hs-var">pprMod</span></a></span><span> </span><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949549"><span class="hs-identifier hs-var">mods</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-652"></span><span>    </span><span class="hs-special">)</span><span>
</span><span id="line-653"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-654"></span><span>    </span><span id="local-6989586621680949547"><span class="annot"><span class="annottext">unambiguousPackages :: Maybe [Unit]
</span><a href="#local-6989586621680949547"><span class="hs-identifier hs-var hs-var">unambiguousPackages</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Maybe [Unit] -&gt; (GenModule Unit, ModuleOrigin) -&gt; Maybe [Unit])
-&gt; Maybe [Unit] -&gt; [(GenModule Unit, ModuleOrigin)] -&gt; Maybe [Unit]
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [Unit] -&gt; (GenModule Unit, ModuleOrigin) -&gt; Maybe [Unit]
forall {a}. Maybe [a] -&gt; (GenModule a, ModuleOrigin) -&gt; Maybe [a]
</span><a href="#local-6989586621680949534"><span class="hs-identifier hs-var">unambiguousPackage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Unit] -&gt; Maybe [Unit]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(GenModule Unit, ModuleOrigin)]
</span><a href="#local-6989586621680949549"><span class="hs-identifier hs-var">mods</span></a></span><span>
</span><span id="line-655"></span><span>    </span><span id="local-6989586621680949534"><span class="annot"><span class="annottext">unambiguousPackage :: Maybe [a] -&gt; (GenModule a, ModuleOrigin) -&gt; Maybe [a]
</span><a href="#local-6989586621680949534"><span class="hs-identifier hs-var hs-var">unambiguousPackage</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949533"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680949533"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680949532"><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949532"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Unit.State.html#ModOrigin"><span class="hs-identifier hs-type">ModOrigin</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[UnitInfo]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[UnitInfo]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-656"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Maybe [a]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule a -&gt; a
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949532"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; [a] -&gt; [a]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621680949533"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-657"></span><span>    </span><span class="annot"><a href="#local-6989586621680949534"><span class="hs-identifier hs-var">unambiguousPackage</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [a]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">(GenModule a, ModuleOrigin)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe [a]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-658"></span><span>
</span><span id="line-659"></span><span>    </span><span id="local-6989586621680949537"><span class="annot"><span class="annottext">pprMod :: (GenModule a, ModuleOrigin) -&gt; SDoc
</span><a href="#local-6989586621680949537"><span class="hs-identifier hs-var hs-var">pprMod</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680949526"><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949526"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680949525"><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="#local-6989586621680949525"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;it is bound as&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949526"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-660"></span><span>                                </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;by&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule a -&gt; ModuleOrigin -&gt; SDoc
forall {a}. Outputable a =&gt; GenModule a -&gt; ModuleOrigin -&gt; SDoc
</span><a href="#local-6989586621680949524"><span class="hs-identifier hs-var">pprOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949526"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="#local-6989586621680949525"><span class="hs-identifier hs-var">o</span></a></span><span>
</span><span id="line-661"></span><span>    </span><span id="local-6989586621680949524"><span class="annot"><span class="annottext">pprOrigin :: GenModule a -&gt; ModuleOrigin -&gt; SDoc
</span><a href="#local-6989586621680949524"><span class="hs-identifier hs-var hs-var">pprOrigin</span></a></span></span><span> </span><span class="annot"><span class="annottext">GenModule a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="GHC.Unit.State.html#ModHidden"><span class="hs-identifier hs-var">ModHidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cantFindErr: bound by mod hidden&quot;</span></span><span>
</span><span id="line-662"></span><span>    </span><span class="annot"><a href="#local-6989586621680949524"><span class="hs-identifier hs-var">pprOrigin</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.State.html#ModUnusable"><span class="hs-identifier hs-type">ModUnusable</span></a></span><span> </span><span class="annot"><span class="annottext">UnusableUnitReason
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cantFindErr: bound by mod unusable&quot;</span></span><span>
</span><span id="line-663"></span><span>    </span><span class="annot"><a href="#local-6989586621680949524"><span class="hs-identifier hs-var">pprOrigin</span></a></span><span> </span><span id="local-6989586621680949514"><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949514"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.State.html#ModOrigin"><span class="hs-identifier hs-type">ModOrigin</span></a></span><span> </span><span id="local-6989586621680949513"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621680949513"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621680949512"><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949512"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="annot"><span class="annottext">[UnitInfo]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680949511"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680949511"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="annot"><span class="annottext">([SDoc] -&gt; SDoc) -&gt; [SDoc] -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; [SDoc] -&gt; [SDoc]
</span><a href="GHC.Utils.Outputable.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-664"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621680949513"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool -&gt; Maybe Bool -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Maybe Bool
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-665"></span><span>          </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;package&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule a -&gt; a
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule a
</span><a href="#local-6989586621680949514"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-666"></span><span>          </span><span class="hs-keyword">else</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; [SDoc] -&gt; [SDoc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-667"></span><span>      </span><span class="annot"><span class="annottext">(UnitInfo -&gt; SDoc) -&gt; [UnitInfo] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a reexport in package&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-668"></span><span>                </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; (UnitInfo -&gt; SDoc) -&gt; UnitInfo -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span class="annot"><span class="annottext">(Unit -&gt; SDoc) -&gt; (UnitInfo -&gt; Unit) -&gt; UnitInfo -&gt; SDoc
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span class="annot"><span class="annottext">UnitInfo -&gt; Unit
</span><a href="GHC.Unit.Info.html#mkUnit"><span class="hs-identifier hs-var">mkUnit</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949512"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; [SDoc] -&gt; [SDoc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-669"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680949511"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a package flag&quot;</span></span><span class="hs-special">]</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-670"></span><span>      </span><span class="hs-special">)</span><span>
</span><span id="line-671"></span><span>
</span><span id="line-672"></span><span class="annot"><a href="GHC.Driver.Finder.html#cantFindErr"><span class="hs-identifier hs-var">cantFindErr</span></a></span><span> </span><span id="local-6989586621680949507"><span class="annot"><span class="annottext">PtrString
</span><a href="#local-6989586621680949507"><span class="hs-identifier hs-var">cannot_find</span></a></span></span><span> </span><span class="annot"><span class="annottext">PtrString
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680949506"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949505"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949505"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621680949504"><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949504"><span class="hs-identifier hs-var">find_result</span></a></span></span><span>
</span><span id="line-673"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString
</span><a href="#local-6989586621680949507"><span class="hs-identifier hs-var">cannot_find</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949505"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-674"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680949502"><span class="hs-identifier hs-var">more_info</span></a></span><span>
</span><span id="line-675"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-676"></span><span>    </span><span id="local-6989586621680949501"><span class="annot"><span class="annottext">pkgs :: UnitState
</span><a href="#local-6989586621680949501"><span class="hs-identifier hs-var hs-var">pkgs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-677"></span><span>    </span><span id="local-6989586621680949502"><span class="annot"><span class="annottext">more_info :: SDoc
</span><a href="#local-6989586621680949502"><span class="hs-identifier hs-var hs-var">more_info</span></a></span></span><span>
</span><span id="line-678"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FindResult
</span><a href="#local-6989586621680949504"><span class="hs-identifier hs-var">find_result</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-679"></span><span>            </span><span class="annot"><a href="GHC.Driver.Types.html#NoPackage"><span class="hs-identifier hs-type">NoPackage</span></a></span><span> </span><span id="local-6989586621680949489"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949489"><span class="hs-identifier hs-var">pkg</span></a></span></span><span>
</span><span id="line-680"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;no unit id matching&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949489"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-681"></span><span>                   </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;was found&quot;</span></span><span>
</span><span id="line-682"></span><span>
</span><span id="line-683"></span><span>            </span><span class="annot"><a href="GHC.Driver.Types.html#NotFound"><span class="hs-identifier hs-type">NotFound</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fr_paths :: FindResult -&gt; [String]
</span><a href="GHC.Driver.Types.html#fr_paths"><span class="hs-identifier hs-var">fr_paths</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949488"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949488"><span class="hs-identifier hs-var">files</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkg :: FindResult -&gt; Maybe Unit
</span><a href="GHC.Driver.Types.html#fr_pkg"><span class="hs-identifier hs-var">fr_pkg</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949487"><span class="annot"><span class="annottext">Maybe Unit
</span><a href="#local-6989586621680949487"><span class="hs-identifier hs-var">mb_pkg</span></a></span></span><span>
</span><span id="line-684"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_mods_hidden :: FindResult -&gt; [Unit]
</span><a href="GHC.Driver.Types.html#fr_mods_hidden"><span class="hs-identifier hs-var">fr_mods_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949486"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949486"><span class="hs-identifier hs-var">mod_hiddens</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_pkgs_hidden :: FindResult -&gt; [Unit]
</span><a href="GHC.Driver.Types.html#fr_pkgs_hidden"><span class="hs-identifier hs-var">fr_pkgs_hidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949485"><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949485"><span class="hs-identifier hs-var">pkg_hiddens</span></a></span></span><span>
</span><span id="line-685"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_unusables :: FindResult -&gt; [(Unit, UnusableUnitReason)]
</span><a href="GHC.Driver.Types.html#fr_unusables"><span class="hs-identifier hs-var">fr_unusables</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949484"><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949484"><span class="hs-identifier hs-var">unusables</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fr_suggestions :: FindResult -&gt; [ModuleSuggestion]
</span><a href="GHC.Driver.Types.html#fr_suggestions"><span class="hs-identifier hs-var">fr_suggestions</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949483"><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949483"><span class="hs-identifier hs-var">suggest</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-686"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949482"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949482"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe Unit
</span><a href="#local-6989586621680949487"><span class="hs-identifier hs-var">mb_pkg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949482"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; Unit -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Unit
</span><a href="GHC.Driver.Session.html#homeUnit"><span class="hs-identifier hs-var">homeUnit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-687"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Unit -&gt; [String] -&gt; SDoc
forall {a}. Outputable a =&gt; a -&gt; [String] -&gt; SDoc
</span><a href="#local-6989586621680949480"><span class="hs-identifier hs-var">not_found_in_package</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949482"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949488"><span class="hs-identifier hs-var">files</span></a></span><span>
</span><span id="line-688"></span><span>
</span><span id="line-689"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ModuleSuggestion] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949483"><span class="hs-identifier hs-var">suggest</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-690"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion] -&gt; SDoc
</span><a href="#local-6989586621680949479"><span class="hs-identifier hs-var">pp_suggestions</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949483"><span class="hs-identifier hs-var">suggest</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; DynFlags -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-var">tried_these</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949488"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-691"></span><span>
</span><span id="line-692"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949488"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Unit] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949486"><span class="hs-identifier hs-var">mod_hiddens</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-693"></span><span>                  </span><span class="annot"><span class="annottext">[Unit] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949485"><span class="hs-identifier hs-var">pkg_hiddens</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949484"><span class="hs-identifier hs-var">unusables</span></a></span><span>
</span><span id="line-694"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;It is not a module in the current program, or in any known package.&quot;</span></span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-697"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Unit -&gt; SDoc) -&gt; [Unit] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
</span><a href="#local-6989586621680949477"><span class="hs-identifier hs-var">pkg_hidden</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949485"><span class="hs-identifier hs-var">pkg_hiddens</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-698"></span><span>                   </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Unit -&gt; SDoc) -&gt; [Unit] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="#local-6989586621680949476"><span class="hs-identifier hs-var">mod_hidden</span></a></span><span> </span><span class="annot"><span class="annottext">[Unit]
</span><a href="#local-6989586621680949486"><span class="hs-identifier hs-var">mod_hiddens</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-699"></span><span>                   </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Unit, UnusableUnitReason) -&gt; SDoc)
-&gt; [(Unit, UnusableUnitReason)] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Unit, UnusableUnitReason) -&gt; SDoc
forall {a}. Outputable a =&gt; (a, UnusableUnitReason) -&gt; SDoc
</span><a href="#local-6989586621680949475"><span class="hs-identifier hs-var">unusable</span></a></span><span> </span><span class="annot"><span class="annottext">[(Unit, UnusableUnitReason)]
</span><a href="#local-6989586621680949484"><span class="hs-identifier hs-var">unusables</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-700"></span><span>                   </span><span class="annot"><span class="annottext">[String] -&gt; DynFlags -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-var">tried_these</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949488"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-701"></span><span>
</span><span id="line-702"></span><span>            </span><span class="annot"><span class="annottext">FindResult
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cantFindErr&quot;</span></span><span>
</span><span id="line-703"></span><span>
</span><span id="line-704"></span><span>    </span><span id="local-6989586621680949474"><span class="annot"><span class="annottext">build_tag :: String
</span><a href="#local-6989586621680949474"><span class="hs-identifier hs-var hs-var">build_tag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set Way -&gt; String
</span><a href="GHC.Driver.Ways.html#waysBuildTag"><span class="hs-identifier hs-var">waysBuildTag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Set Way
</span><a href="GHC.Driver.Session.html#ways"><span class="hs-identifier hs-var hs-var">ways</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-705"></span><span>
</span><span id="line-706"></span><span>    </span><span id="local-6989586621680949480"><span class="annot"><span class="annottext">not_found_in_package :: a -&gt; [String] -&gt; SDoc
</span><a href="#local-6989586621680949480"><span class="hs-identifier hs-var hs-var">not_found_in_package</span></a></span></span><span> </span><span id="local-6989586621680949468"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949468"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span id="local-6989586621680949467"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949467"><span class="hs-identifier hs-var">files</span></a></span></span><span>
</span><span id="line-707"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949474"><span class="hs-identifier hs-var">build_tag</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-708"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-709"></span><span>            </span><span id="local-6989586621680949464"><span class="annot"><span class="annottext">build :: String
</span><a href="#local-6989586621680949464"><span class="hs-identifier hs-var hs-var">build</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949474"><span class="hs-identifier hs-var">build_tag</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;p&quot;</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;profiling&quot;</span></span><span>
</span><span id="line-710"></span><span>                                        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949474"><span class="hs-identifier hs-var">build_tag</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\&quot;&quot;</span></span><span>
</span><span id="line-711"></span><span>         </span><span class="hs-keyword">in</span><span>
</span><span id="line-712"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you haven't installed the &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949464"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-713"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; libraries for package &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949468"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'?'</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-714"></span><span>         </span><span class="annot"><span class="annottext">[String] -&gt; DynFlags -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-var">tried_these</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949467"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-715"></span><span>
</span><span id="line-716"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-717"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;There are files missing in the &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949468"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-718"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; package,&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-719"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;try running 'ghc-pkg check'.&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-720"></span><span>         </span><span class="annot"><span class="annottext">[String] -&gt; DynFlags -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-var">tried_these</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949467"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-721"></span><span>
</span><span id="line-722"></span><span>    </span><span class="annot"><a href="#local-6989586621680949477"><span class="hs-identifier hs-type">pkg_hidden</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Unit"><span class="hs-identifier hs-type">Unit</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-723"></span><span>    </span><span id="local-6989586621680949477"><span class="annot"><span class="annottext">pkg_hidden :: Unit -&gt; SDoc
</span><a href="#local-6989586621680949477"><span class="hs-identifier hs-var hs-var">pkg_hidden</span></a></span></span><span> </span><span id="local-6989586621680949462"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949462"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-724"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;It is a member of the hidden package&quot;</span></span><span>
</span><span id="line-725"></span><span>        </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949462"><span class="hs-identifier hs-var">uid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-726"></span><span>        </span><span class="hs-comment">--FIXME: we don't really want to show the unit id here we should</span><span>
</span><span id="line-727"></span><span>        </span><span class="hs-comment">-- show the source package id or installed package id if it's ambiguous</span><span>
</span><span id="line-728"></span><span>        </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dot"><span class="hs-identifier hs-var">dot</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
</span><a href="#local-6989586621680949460"><span class="hs-identifier hs-var">pkg_hidden_hint</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949462"><span class="hs-identifier hs-var">uid</span></a></span><span>
</span><span id="line-729"></span><span>    </span><span id="local-6989586621680949460"><span class="annot"><span class="annottext">pkg_hidden_hint :: Unit -&gt; SDoc
</span><a href="#local-6989586621680949460"><span class="hs-identifier hs-var hs-var">pkg_hidden_hint</span></a></span></span><span> </span><span id="local-6989586621680949456"><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949456"><span class="hs-identifier hs-var">uid</span></a></span></span><span>
</span><span id="line-730"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_BuildingCabalPackage"><span class="hs-identifier hs-var">Opt_BuildingCabalPackage</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949506"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-731"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680949452"><span class="annot"><span class="annottext">pkg :: UnitInfo
</span><a href="#local-6989586621680949452"><span class="hs-identifier hs-var hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Maybe UnitInfo -&gt; UnitInfo
forall a. HasCallStack =&gt; String -&gt; Maybe a -&gt; a
</span><a href="GHC.Data.Maybe.html#expectJust"><span class="hs-identifier hs-var">expectJust</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pkg_hidden&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitState -&gt; Unit -&gt; Maybe UnitInfo
</span><a href="GHC.Unit.State.html#lookupUnit"><span class="hs-identifier hs-var">lookupUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621680949501"><span class="hs-identifier hs-var">pkgs</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949456"><span class="hs-identifier hs-var">uid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-732"></span><span>           </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you need to add&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-733"></span><span>              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitInfo -&gt; PackageName
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; srcpkgname
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitPackageName"><span class="hs-identifier hs-var hs-var">unitPackageName</span></a></span><span> </span><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949452"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-734"></span><span>              </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;to the build-depends in your .cabal file.&quot;</span></span><span>
</span><span id="line-735"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949449"><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949449"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; Unit -&gt; Maybe UnitInfo
</span><a href="GHC.Unit.State.html#lookupUnit"><span class="hs-identifier hs-var">lookupUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621680949501"><span class="hs-identifier hs-var">pkgs</span></a></span><span> </span><span class="annot"><span class="annottext">Unit
</span><a href="#local-6989586621680949456"><span class="hs-identifier hs-var">uid</span></a></span><span>
</span><span id="line-736"></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;You can run&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-737"></span><span>           </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;:set -package &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitInfo -&gt; PackageName
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; srcpkgname
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitPackageName"><span class="hs-identifier hs-var hs-var">unitPackageName</span></a></span><span> </span><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949449"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-738"></span><span>           </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;to expose it.&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-739"></span><span>           </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;(Note: this unloads all the modules in the current scope.)&quot;</span></span><span>
</span><span id="line-740"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-741"></span><span>
</span><span id="line-742"></span><span>    </span><span id="local-6989586621680949476"><span class="annot"><span class="annottext">mod_hidden :: a -&gt; SDoc
</span><a href="#local-6989586621680949476"><span class="hs-identifier hs-var hs-var">mod_hidden</span></a></span></span><span> </span><span id="local-6989586621680949445"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949445"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-743"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;it is a hidden module in the package&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949445"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-744"></span><span>
</span><span id="line-745"></span><span>    </span><span id="local-6989586621680949475"><span class="annot"><span class="annottext">unusable :: (a, UnusableUnitReason) -&gt; SDoc
</span><a href="#local-6989586621680949475"><span class="hs-identifier hs-var hs-var">unusable</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680949442"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949442"><span class="hs-identifier hs-var">pkg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680949441"><span class="annot"><span class="annottext">UnusableUnitReason
</span><a href="#local-6989586621680949441"><span class="hs-identifier hs-var">reason</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-746"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;It is a member of the package&quot;</span></span><span>
</span><span id="line-747"></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949442"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-748"></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; UnusableUnitReason -&gt; SDoc
</span><a href="GHC.Unit.State.html#pprReason"><span class="hs-identifier hs-var">pprReason</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;which is&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">UnusableUnitReason
</span><a href="#local-6989586621680949441"><span class="hs-identifier hs-var">reason</span></a></span><span>
</span><span id="line-749"></span><span>
</span><span id="line-750"></span><span>    </span><span class="annot"><a href="#local-6989586621680949479"><span class="hs-identifier hs-type">pp_suggestions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Unit.State.html#ModuleSuggestion"><span class="hs-identifier hs-type">ModuleSuggestion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-751"></span><span>    </span><span id="local-6989586621680949479"><span class="annot"><span class="annottext">pp_suggestions :: [ModuleSuggestion] -&gt; SDoc
</span><a href="#local-6989586621680949479"><span class="hs-identifier hs-var hs-var">pp_suggestions</span></a></span></span><span> </span><span id="local-6989586621680949439"><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949439"><span class="hs-identifier hs-var">sugs</span></a></span></span><span>
</span><span id="line-752"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949439"><span class="hs-identifier hs-var">sugs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-753"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you meant&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-754"></span><span>                       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(ModuleSuggestion -&gt; SDoc) -&gt; [ModuleSuggestion] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSuggestion -&gt; SDoc
</span><a href="#local-6989586621680949438"><span class="hs-identifier hs-var">pp_sugg</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleSuggestion]
</span><a href="#local-6989586621680949439"><span class="hs-identifier hs-var">sugs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-755"></span><span>
</span><span id="line-756"></span><span>    </span><span class="hs-comment">-- NB: Prefer the *original* location, and then reexports, and then</span><span>
</span><span id="line-757"></span><span>    </span><span class="hs-comment">-- package flags when making suggestions.  ToDo: if the original package</span><span>
</span><span id="line-758"></span><span>    </span><span class="hs-comment">-- also has a reexport, prefer that one</span><span>
</span><span id="line-759"></span><span>    </span><span id="local-6989586621680949438"><span class="annot"><span class="annottext">pp_sugg :: ModuleSuggestion -&gt; SDoc
</span><a href="#local-6989586621680949438"><span class="hs-identifier hs-var hs-var">pp_sugg</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.State.html#SuggestVisible"><span class="hs-identifier hs-type">SuggestVisible</span></a></span><span> </span><span id="local-6989586621680949434"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949434"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680949433"><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949433"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949432"><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="#local-6989586621680949432"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949434"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin -&gt; SDoc
</span><a href="#local-6989586621680949431"><span class="hs-identifier hs-var">provenance</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="#local-6989586621680949432"><span class="hs-identifier hs-var">o</span></a></span><span>
</span><span id="line-760"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680949431"><span class="annot"><span class="annottext">provenance :: ModuleOrigin -&gt; SDoc
</span><a href="#local-6989586621680949431"><span class="hs-identifier hs-var hs-var">provenance</span></a></span></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="GHC.Unit.State.html#ModHidden"><span class="hs-identifier hs-var">ModHidden</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-761"></span><span>            </span><span class="annot"><a href="#local-6989586621680949431"><span class="hs-identifier hs-var">provenance</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.State.html#ModUnusable"><span class="hs-identifier hs-type">ModUnusable</span></a></span><span> </span><span class="annot"><span class="annottext">UnusableUnitReason
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-762"></span><span>            </span><span class="annot"><a href="#local-6989586621680949431"><span class="hs-identifier hs-var">provenance</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.State.html#ModOrigin"><span class="hs-identifier hs-type">ModOrigin</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fromOrigUnit :: ModuleOrigin -&gt; Maybe Bool
</span><a href="GHC.Unit.State.html#fromOrigUnit"><span class="hs-identifier hs-var">fromOrigUnit</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949422"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621680949422"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-763"></span><span>                                   </span><span class="annot"><span class="annottext">fromExposedReexport :: ModuleOrigin -&gt; [UnitInfo]
</span><a href="GHC.Unit.State.html#fromExposedReexport"><span class="hs-identifier hs-var">fromExposedReexport</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949420"><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949420"><span class="hs-identifier hs-var">res</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-764"></span><span>                                   </span><span class="annot"><span class="annottext">fromPackageFlag :: ModuleOrigin -&gt; Bool
</span><a href="GHC.Unit.State.html#fromPackageFlag"><span class="hs-identifier hs-var">fromPackageFlag</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949418"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680949418"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-765"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621680949422"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-766"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;from&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949433"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-767"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680949418"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">GenModule Unit -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949433"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; ModuleName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949434"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-768"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;from&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949433"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-769"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680949416"><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949416"><span class="hs-identifier hs-var">pkg</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[UnitInfo]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949420"><span class="hs-identifier hs-var">res</span></a></span><span>
</span><span id="line-770"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;from&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitInfo -&gt; Unit
</span><a href="GHC.Unit.Info.html#mkUnit"><span class="hs-identifier hs-var">mkUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949416"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-771"></span><span>                    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#comma"><span class="hs-identifier hs-var">comma</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;reexporting&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949433"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-772"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680949418"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-773"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;defined via package flags to be&quot;</span></span><span>
</span><span id="line-774"></span><span>                    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949433"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-775"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-776"></span><span>    </span><span class="annot"><a href="#local-6989586621680949438"><span class="hs-identifier hs-var">pp_sugg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.State.html#SuggestHidden"><span class="hs-identifier hs-type">SuggestHidden</span></a></span><span> </span><span id="local-6989586621680949414"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949414"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621680949413"><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949413"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span id="local-6989586621680949412"><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="#local-6989586621680949412"><span class="hs-identifier hs-var">o</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949414"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin -&gt; SDoc
</span><a href="#local-6989586621680949411"><span class="hs-identifier hs-var">provenance</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="#local-6989586621680949412"><span class="hs-identifier hs-var">o</span></a></span><span>
</span><span id="line-777"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680949411"><span class="annot"><span class="annottext">provenance :: ModuleOrigin -&gt; SDoc
</span><a href="#local-6989586621680949411"><span class="hs-identifier hs-var hs-var">provenance</span></a></span></span><span> </span><span class="annot"><span class="annottext">ModuleOrigin
</span><a href="GHC.Unit.State.html#ModHidden"><span class="hs-identifier hs-var">ModHidden</span></a></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-778"></span><span>            </span><span class="annot"><a href="#local-6989586621680949411"><span class="hs-identifier hs-var">provenance</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.State.html#ModUnusable"><span class="hs-identifier hs-type">ModUnusable</span></a></span><span> </span><span class="annot"><span class="annottext">UnusableUnitReason
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-779"></span><span>            </span><span class="annot"><a href="#local-6989586621680949411"><span class="hs-identifier hs-var">provenance</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.State.html#ModOrigin"><span class="hs-identifier hs-type">ModOrigin</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fromOrigUnit :: ModuleOrigin -&gt; Maybe Bool
</span><a href="GHC.Unit.State.html#fromOrigUnit"><span class="hs-identifier hs-var">fromOrigUnit</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949408"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621680949408"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">,</span><span>
</span><span id="line-780"></span><span>                                   </span><span class="annot"><span class="annottext">fromHiddenReexport :: ModuleOrigin -&gt; [UnitInfo]
</span><a href="GHC.Unit.State.html#fromHiddenReexport"><span class="hs-identifier hs-var">fromHiddenReexport</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621680949406"><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949406"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-781"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621680949408"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-782"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;needs flag -package-id&quot;</span></span><span>
</span><span id="line-783"></span><span>                    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GenModule Unit -&gt; Unit
forall unit. GenModule unit -&gt; unit
</span><a href="GHC.Unit.Types.html#moduleUnit"><span class="hs-identifier hs-var hs-var">moduleUnit</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit
</span><a href="#local-6989586621680949413"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-784"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680949405"><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949405"><span class="hs-identifier hs-var">pkg</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[UnitInfo]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949406"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-785"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;needs flag -package-id&quot;</span></span><span>
</span><span id="line-786"></span><span>                    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Unit -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitInfo -&gt; Unit
</span><a href="GHC.Unit.Info.html#mkUnit"><span class="hs-identifier hs-var">mkUnit</span></a></span><span> </span><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949405"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-787"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-788"></span><span>
</span><span id="line-789"></span><span class="annot"><a href="GHC.Driver.Finder.html#cantFindInstalledErr"><span class="hs-identifier hs-type">cantFindInstalledErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span>
</span><span id="line-790"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledFindResult"><span class="hs-identifier hs-type">InstalledFindResult</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-791"></span><span id="cantFindInstalledErr"><span class="annot"><span class="annottext">cantFindInstalledErr :: PtrString
-&gt; PtrString
-&gt; DynFlags
-&gt; ModuleName
-&gt; InstalledFindResult
-&gt; SDoc
</span><a href="GHC.Driver.Finder.html#cantFindInstalledErr"><span class="hs-identifier hs-var hs-var">cantFindInstalledErr</span></a></span></span><span> </span><span id="local-6989586621680949404"><span class="annot"><span class="annottext">PtrString
</span><a href="#local-6989586621680949404"><span class="hs-identifier hs-var">cannot_find</span></a></span></span><span> </span><span class="annot"><span class="annottext">PtrString
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680949403"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949403"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621680949402"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949402"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621680949401"><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949401"><span class="hs-identifier hs-var">find_result</span></a></span></span><span>
</span><span id="line-792"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString
</span><a href="#local-6989586621680949404"><span class="hs-identifier hs-var">cannot_find</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621680949402"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-793"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621680949400"><span class="hs-identifier hs-var">more_info</span></a></span><span>
</span><span id="line-794"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-795"></span><span>    </span><span id="local-6989586621680949400"><span class="annot"><span class="annottext">more_info :: SDoc
</span><a href="#local-6989586621680949400"><span class="hs-identifier hs-var hs-var">more_info</span></a></span></span><span>
</span><span id="line-796"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InstalledFindResult
</span><a href="#local-6989586621680949401"><span class="hs-identifier hs-var">find_result</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-797"></span><span>            </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledNoPackage"><span class="hs-identifier hs-type">InstalledNoPackage</span></a></span><span> </span><span id="local-6989586621680949396"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949396"><span class="hs-identifier hs-var">pkg</span></a></span></span><span>
</span><span id="line-798"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;no unit id matching&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949396"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-799"></span><span>                   </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;was found&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; SDoc
</span><a href="#local-6989586621680949395"><span class="hs-identifier hs-var">looks_like_srcpkgid</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949396"><span class="hs-identifier hs-var">pkg</span></a></span><span>
</span><span id="line-800"></span><span>
</span><span id="line-801"></span><span>            </span><span class="annot"><a href="GHC.Driver.Types.html#InstalledNotFound"><span class="hs-identifier hs-type">InstalledNotFound</span></a></span><span> </span><span id="local-6989586621680949394"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949394"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span id="local-6989586621680949393"><span class="annot"><span class="annottext">Maybe UnitId
</span><a href="#local-6989586621680949393"><span class="hs-identifier hs-var">mb_pkg</span></a></span></span><span>
</span><span id="line-802"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680949392"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949392"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe UnitId
</span><a href="#local-6989586621680949393"><span class="hs-identifier hs-var">mb_pkg</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949392"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; Unit -&gt; Bool
</span><a href="GHC.Unit.Module.html#unitIdEq"><span class="hs-operator hs-var">`unitIdEq`</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Unit
</span><a href="GHC.Driver.Session.html#homeUnit"><span class="hs-identifier hs-var">homeUnit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949403"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-803"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; [String] -&gt; SDoc
forall {a}. Outputable a =&gt; a -&gt; [String] -&gt; SDoc
</span><a href="#local-6989586621680949391"><span class="hs-identifier hs-var">not_found_in_package</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949392"><span class="hs-identifier hs-var">pkg</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949394"><span class="hs-identifier hs-var">files</span></a></span><span>
</span><span id="line-804"></span><span>
</span><span id="line-805"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949394"><span class="hs-identifier hs-var">files</span></a></span><span>
</span><span id="line-806"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;It is not a module in the current program, or in any known package.&quot;</span></span><span>
</span><span id="line-807"></span><span>
</span><span id="line-808"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-809"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; DynFlags -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-var">tried_these</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949394"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949403"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-810"></span><span>
</span><span id="line-811"></span><span>            </span><span class="annot"><span class="annottext">InstalledFindResult
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;cantFindInstalledErr&quot;</span></span><span>
</span><span id="line-812"></span><span>
</span><span id="line-813"></span><span>    </span><span id="local-6989586621680949390"><span class="annot"><span class="annottext">build_tag :: String
</span><a href="#local-6989586621680949390"><span class="hs-identifier hs-var hs-var">build_tag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Set Way -&gt; String
</span><a href="GHC.Driver.Ways.html#waysBuildTag"><span class="hs-identifier hs-var">waysBuildTag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Set Way
</span><a href="GHC.Driver.Session.html#ways"><span class="hs-identifier hs-var hs-var">ways</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949403"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-814"></span><span>    </span><span id="local-6989586621680949389"><span class="annot"><span class="annottext">pkgstate :: UnitState
</span><a href="#local-6989586621680949389"><span class="hs-identifier hs-var hs-var">pkgstate</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UnitState
</span><a href="GHC.Driver.Session.html#unitState"><span class="hs-identifier hs-var hs-var">unitState</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949403"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-815"></span><span>
</span><span id="line-816"></span><span>    </span><span class="annot"><a href="#local-6989586621680949395"><span class="hs-identifier hs-type">looks_like_srcpkgid</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-817"></span><span>    </span><span id="local-6989586621680949395"><span class="annot"><span class="annottext">looks_like_srcpkgid :: UnitId -&gt; SDoc
</span><a href="#local-6989586621680949395"><span class="hs-identifier hs-var hs-var">looks_like_srcpkgid</span></a></span></span><span> </span><span id="local-6989586621680949388"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949388"><span class="hs-identifier hs-var">pk</span></a></span></span><span>
</span><span id="line-818"></span><span>     </span><span class="hs-comment">-- Unsafely coerce a unit id (i.e. an installed package component</span><span>
</span><span id="line-819"></span><span>     </span><span class="hs-comment">-- identifier) into a PackageId and see if it means anything.</span><span>
</span><span id="line-820"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680949387"><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949387"><span class="hs-identifier hs-var">pkg</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680949386"><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949386"><span class="hs-identifier hs-var">pkgs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnitState -&gt; PackageId -&gt; [UnitInfo]
</span><a href="GHC.Unit.State.html#searchPackageId"><span class="hs-identifier hs-var">searchPackageId</span></a></span><span> </span><span class="annot"><span class="annottext">UnitState
</span><a href="#local-6989586621680949389"><span class="hs-identifier hs-var">pkgstate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; PackageId
</span><a href="GHC.Unit.Info.html#PackageId"><span class="hs-identifier hs-var">PackageId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; FastString
</span><a href="GHC.Unit.Types.html#unitIdFS"><span class="hs-identifier hs-var hs-var">unitIdFS</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621680949388"><span class="hs-identifier hs-var">pk</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-821"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;This unit ID looks like the source package ID;&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-822"></span><span>       </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;the real unit ID is&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ftext"><span class="hs-identifier hs-var">ftext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; FastString
</span><a href="GHC.Unit.Types.html#unitIdFS"><span class="hs-identifier hs-var hs-var">unitIdFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitInfo -&gt; UnitId
forall compid srcpkgid srcpkgname uid modulename mod.
GenericUnitInfo compid srcpkgid srcpkgname uid modulename mod
-&gt; uid
</span><a href="../../ghc-boot/src/GHC.Unit.Database.html#unitId"><span class="hs-identifier hs-var hs-var">unitId</span></a></span><span> </span><span class="annot"><span class="annottext">UnitInfo
</span><a href="#local-6989586621680949387"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-823"></span><span>       </span><span class="hs-special">(</span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[UnitInfo] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949386"><span class="hs-identifier hs-var">pkgs</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-824"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;and&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[UnitInfo] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[UnitInfo]
</span><a href="#local-6989586621680949386"><span class="hs-identifier hs-var">pkgs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;other candidates&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-825"></span><span>     </span><span class="hs-comment">-- Todo: also check if it looks like a package name!</span><span>
</span><span id="line-826"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-827"></span><span>
</span><span id="line-828"></span><span>    </span><span id="local-6989586621680949391"><span class="annot"><span class="annottext">not_found_in_package :: a -&gt; [String] -&gt; SDoc
</span><a href="#local-6989586621680949391"><span class="hs-identifier hs-var hs-var">not_found_in_package</span></a></span></span><span> </span><span id="local-6989586621680949374"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949374"><span class="hs-identifier hs-var">pkg</span></a></span></span><span> </span><span id="local-6989586621680949373"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949373"><span class="hs-identifier hs-var">files</span></a></span></span><span>
</span><span id="line-829"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949390"><span class="hs-identifier hs-var">build_tag</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-830"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-831"></span><span>            </span><span id="local-6989586621680949370"><span class="annot"><span class="annottext">build :: String
</span><a href="#local-6989586621680949370"><span class="hs-identifier hs-var hs-var">build</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949390"><span class="hs-identifier hs-var">build_tag</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;p&quot;</span></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;profiling&quot;</span></span><span>
</span><span id="line-832"></span><span>                                        </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949390"><span class="hs-identifier hs-var">build_tag</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\&quot;&quot;</span></span><span>
</span><span id="line-833"></span><span>         </span><span class="hs-keyword">in</span><span>
</span><span id="line-834"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you haven't installed the &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680949370"><span class="hs-identifier hs-var">build</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-835"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; libraries for package &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949374"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'?'</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-836"></span><span>         </span><span class="annot"><span class="annottext">[String] -&gt; DynFlags -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-var">tried_these</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949373"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949403"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-837"></span><span>
</span><span id="line-838"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-839"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;There are files missing in the &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621680949374"><span class="hs-identifier hs-var">pkg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-840"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; package,&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-841"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;try running 'ghc-pkg check'.&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-842"></span><span>         </span><span class="annot"><span class="annottext">[String] -&gt; DynFlags -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-var">tried_these</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949373"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949403"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-843"></span><span>
</span><span id="line-844"></span><span class="annot"><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-type">tried_these</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-845"></span><span id="tried_these"><span class="annot"><span class="annottext">tried_these :: [String] -&gt; DynFlags -&gt; SDoc
</span><a href="GHC.Driver.Finder.html#tried_these"><span class="hs-identifier hs-var hs-var">tried_these</span></a></span></span><span> </span><span id="local-6989586621680949369"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949369"><span class="hs-identifier hs-var">files</span></a></span></span><span> </span><span id="local-6989586621680949368"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949368"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>
</span><span id="line-846"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949369"><span class="hs-identifier hs-var">files</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-847"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#verbosity"><span class="hs-identifier hs-var hs-var">verbosity</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621680949368"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-848"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Use -v (or `:set -v` in ghci) &quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-849"></span><span>              </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;to see a list of the files searched for.&quot;</span></span><span>
</span><span id="line-850"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-851"></span><span>          </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Locations searched:&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">(SDoc -&gt; SDoc) -&gt; SDoc -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; SDoc) -&gt; [String] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621680949369"><span class="hs-identifier hs-var">files</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-852"></span></pre></body></html>